merge mozilla-inbound to mozilla-central. r=merge a=merge
authorSebastian Hengst <archaeopteryx@coole-files.de>
Wed, 13 Sep 2017 11:27:47 +0200
changeset 429858 9873269746359dbcccbd5b44f0e82c0225289945
parent 429762 124f2094635bbf1901c1d14fc2c0a80bf7f847bb (current diff)
parent 429857 c991b71d36422d8adecfe27268d18c62faa5b63c (diff)
child 430026 1888ec2f277f6bb26271b8808e08914a21db9efe
child 430030 5fadfed6db0cf0d6de4d127b1d85e077b29a0090
child 430155 fa027280892fb64c1ccec36e34da095b01bb870d
push id7761
push userjlund@mozilla.com
push dateFri, 15 Sep 2017 00:19:52 +0000
treeherdermozilla-beta@c38455951db4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmerge, merge
milestone57.0a1
first release with
nightly linux32
987326974635 / 57.0a1 / 20170913100125 / files
nightly linux64
987326974635 / 57.0a1 / 20170913100125 / files
nightly mac
987326974635 / 57.0a1 / 20170913100125 / files
nightly win32
987326974635 / 57.0a1 / 20170913100125 / files
nightly win64
987326974635 / 57.0a1 / 20170913100125 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
merge mozilla-inbound to mozilla-central. r=merge a=merge MozReview-Commit-ID: GUc4LEY8qp4
addon-sdk/Makefile.in
addon-sdk/moz.build
addon-sdk/source/.gitattributes
addon-sdk/source/.gitignore
addon-sdk/source/.hgignore
addon-sdk/source/.hgtags
addon-sdk/source/.jpmignore
addon-sdk/source/.travis.yml
addon-sdk/source/CONTRIBUTING.md
addon-sdk/source/LICENSE
addon-sdk/source/README.md
addon-sdk/source/app-extension/application.ini
addon-sdk/source/app-extension/bootstrap.js
addon-sdk/source/app-extension/install.rdf
addon-sdk/source/bin/activate
addon-sdk/source/bin/activate.bat
addon-sdk/source/bin/activate.fish
addon-sdk/source/bin/activate.ps1
addon-sdk/source/bin/cfx
addon-sdk/source/bin/cfx.bat
addon-sdk/source/bin/deactivate.bat
addon-sdk/source/bin/fx-download.sh
addon-sdk/source/bin/integration-scripts/buildbot-run-cfx-helper
addon-sdk/source/bin/integration-scripts/integration-check
addon-sdk/source/bin/jpm-test.js
addon-sdk/source/bin/node-scripts/apply-patch.js
addon-sdk/source/bin/node-scripts/test.addons.js
addon-sdk/source/bin/node-scripts/test.docs.js
addon-sdk/source/bin/node-scripts/test.examples.js
addon-sdk/source/bin/node-scripts/test.firefox-bin.js
addon-sdk/source/bin/node-scripts/test.ini.js
addon-sdk/source/bin/node-scripts/test.modules.js
addon-sdk/source/bin/node-scripts/update-ini.js
addon-sdk/source/bin/node-scripts/utils.js
addon-sdk/source/bin/node-scripts/words.txt
addon-sdk/source/examples/actor-repl/README.md
addon-sdk/source/examples/actor-repl/data/codemirror-compressed.js
addon-sdk/source/examples/actor-repl/data/codemirror.css
addon-sdk/source/examples/actor-repl/data/index.html
addon-sdk/source/examples/actor-repl/data/main.css
addon-sdk/source/examples/actor-repl/data/robot.png
addon-sdk/source/examples/actor-repl/index.js
addon-sdk/source/examples/actor-repl/package.json
addon-sdk/source/examples/actor-repl/test/test-main.js
addon-sdk/source/examples/debug-client/data/client.js
addon-sdk/source/examples/debug-client/data/index.html
addon-sdk/source/examples/debug-client/data/plugin.png
addon-sdk/source/examples/debug-client/data/task.js
addon-sdk/source/examples/debug-client/index.js
addon-sdk/source/examples/debug-client/package.json
addon-sdk/source/examples/debug-client/test/test-main.js
addon-sdk/source/examples/reading-data/data/mom.png
addon-sdk/source/examples/reading-data/data/sample.html
addon-sdk/source/examples/reading-data/lib/main.js
addon-sdk/source/examples/reading-data/package.json
addon-sdk/source/examples/reading-data/tests/test-main.js
addon-sdk/source/examples/theme/data/icon-16.png
addon-sdk/source/examples/theme/data/index.html
addon-sdk/source/examples/theme/data/theme.css
addon-sdk/source/examples/theme/lib/main.js
addon-sdk/source/examples/theme/package.json
addon-sdk/source/examples/theme/test/test-main.js
addon-sdk/source/examples/toolbar-api/data/favicon.ico
addon-sdk/source/examples/toolbar-api/data/index.html
addon-sdk/source/examples/toolbar-api/lib/main.js
addon-sdk/source/examples/toolbar-api/package.json
addon-sdk/source/examples/toolbar-api/test/test-main.js
addon-sdk/source/examples/ui-button-apis/lib/main.js
addon-sdk/source/examples/ui-button-apis/package.json
addon-sdk/source/examples/ui-button-apis/tests/test-main.js
addon-sdk/source/gulpfile.js
addon-sdk/source/lib/diffpatcher/.travis.yml
addon-sdk/source/lib/diffpatcher/History.md
addon-sdk/source/lib/diffpatcher/License.md
addon-sdk/source/lib/diffpatcher/Readme.md
addon-sdk/source/lib/diffpatcher/package.json
addon-sdk/source/lib/index.js
addon-sdk/source/lib/jetpack-id/index.js
addon-sdk/source/lib/jetpack-id/package.json
addon-sdk/source/lib/method/.travis.yml
addon-sdk/source/lib/method/History.md
addon-sdk/source/lib/method/License.md
addon-sdk/source/lib/method/Readme.md
addon-sdk/source/lib/method/core.js
addon-sdk/source/lib/method/package.json
addon-sdk/source/lib/mozilla-toolkit-versioning/index.js
addon-sdk/source/lib/mozilla-toolkit-versioning/lib/utils.js
addon-sdk/source/lib/mozilla-toolkit-versioning/package.json
addon-sdk/source/lib/node/os.js
addon-sdk/source/lib/sdk/addon/installer.js
addon-sdk/source/lib/sdk/addon/window.js
addon-sdk/source/lib/sdk/base64.js
addon-sdk/source/lib/sdk/clipboard.js
addon-sdk/source/lib/sdk/console/plain-text.js
addon-sdk/source/lib/sdk/console/traceback.js
addon-sdk/source/lib/sdk/core/disposable.js
addon-sdk/source/lib/sdk/core/heritage.js
addon-sdk/source/lib/sdk/core/namespace.js
addon-sdk/source/lib/sdk/core/observer.js
addon-sdk/source/lib/sdk/core/promise.js
addon-sdk/source/lib/sdk/core/reference.js
addon-sdk/source/lib/sdk/deprecated/unit-test-finder.js
addon-sdk/source/lib/sdk/deprecated/unit-test.js
addon-sdk/source/lib/sdk/deprecated/window-utils.js
addon-sdk/source/lib/sdk/event/chrome.js
addon-sdk/source/lib/sdk/event/core.js
addon-sdk/source/lib/sdk/event/dom.js
addon-sdk/source/lib/sdk/event/target.js
addon-sdk/source/lib/sdk/event/utils.js
addon-sdk/source/lib/sdk/frame/utils.js
addon-sdk/source/lib/sdk/io/file.js
addon-sdk/source/lib/sdk/lang/functional.js
addon-sdk/source/lib/sdk/lang/functional/concurrent.js
addon-sdk/source/lib/sdk/lang/functional/core.js
addon-sdk/source/lib/sdk/lang/functional/helpers.js
addon-sdk/source/lib/sdk/lang/type.js
addon-sdk/source/lib/sdk/lang/weak-set.js
addon-sdk/source/lib/sdk/net/url.js
addon-sdk/source/lib/sdk/platform/xpcom.js
addon-sdk/source/lib/sdk/preferences/service.js
addon-sdk/source/lib/sdk/preferences/utils.js
addon-sdk/source/lib/sdk/private-browsing.js
addon-sdk/source/lib/sdk/private-browsing/utils.js
addon-sdk/source/lib/sdk/querystring.js
addon-sdk/source/lib/sdk/self.js
addon-sdk/source/lib/sdk/system.js
addon-sdk/source/lib/sdk/system/environment.js
addon-sdk/source/lib/sdk/system/events.js
addon-sdk/source/lib/sdk/system/globals.js
addon-sdk/source/lib/sdk/system/process.js
addon-sdk/source/lib/sdk/system/runtime.js
addon-sdk/source/lib/sdk/system/unload.js
addon-sdk/source/lib/sdk/system/xul-app.js
addon-sdk/source/lib/sdk/system/xul-app.jsm
addon-sdk/source/lib/sdk/test.js
addon-sdk/source/lib/sdk/test/assert.js
addon-sdk/source/lib/sdk/test/harness.js
addon-sdk/source/lib/sdk/test/loader.js
addon-sdk/source/lib/sdk/test/options.js
addon-sdk/source/lib/sdk/test/utils.js
addon-sdk/source/lib/sdk/timers.js
addon-sdk/source/lib/sdk/uri/resource.js
addon-sdk/source/lib/sdk/url.js
addon-sdk/source/lib/sdk/url/utils.js
addon-sdk/source/lib/sdk/util/array.js
addon-sdk/source/lib/sdk/util/collection.js
addon-sdk/source/lib/sdk/util/deprecate.js
addon-sdk/source/lib/sdk/util/dispatcher.js
addon-sdk/source/lib/sdk/util/list.js
addon-sdk/source/lib/sdk/util/object.js
addon-sdk/source/lib/sdk/util/sequence.js
addon-sdk/source/lib/sdk/util/uuid.js
addon-sdk/source/lib/sdk/window/utils.js
addon-sdk/source/lib/sdk/zip/utils.js
addon-sdk/source/lib/test.js
addon-sdk/source/lib/toolkit/loader.js
addon-sdk/source/lib/toolkit/require.js
addon-sdk/source/mapping.json
addon-sdk/source/modules/system/Startup.js
addon-sdk/source/modules/system/moz.build
addon-sdk/source/package.json
addon-sdk/source/python-lib/cuddlefish/__init__.py
addon-sdk/source/python-lib/cuddlefish/_version.py
addon-sdk/source/python-lib/cuddlefish/bunch.py
addon-sdk/source/python-lib/cuddlefish/manifest.py
addon-sdk/source/python-lib/cuddlefish/mobile-utils/bootstrap.js
addon-sdk/source/python-lib/cuddlefish/mobile-utils/install.rdf
addon-sdk/source/python-lib/cuddlefish/packaging.py
addon-sdk/source/python-lib/cuddlefish/preflight.py
addon-sdk/source/python-lib/cuddlefish/prefs.py
addon-sdk/source/python-lib/cuddlefish/property_parser.py
addon-sdk/source/python-lib/cuddlefish/rdf.py
addon-sdk/source/python-lib/cuddlefish/runner.py
addon-sdk/source/python-lib/cuddlefish/templates.py
addon-sdk/source/python-lib/cuddlefish/tests/__init__.py
addon-sdk/source/python-lib/cuddlefish/tests/bug-588119-files/packages/explicit-icon/explicit-icon.png
addon-sdk/source/python-lib/cuddlefish/tests/bug-588119-files/packages/explicit-icon/explicit-icon64.png
addon-sdk/source/python-lib/cuddlefish/tests/bug-588119-files/packages/explicit-icon/lib/main.js
addon-sdk/source/python-lib/cuddlefish/tests/bug-588119-files/packages/explicit-icon/package.json
addon-sdk/source/python-lib/cuddlefish/tests/bug-588119-files/packages/implicit-icon/icon.png
addon-sdk/source/python-lib/cuddlefish/tests/bug-588119-files/packages/implicit-icon/icon64.png
addon-sdk/source/python-lib/cuddlefish/tests/bug-588119-files/packages/implicit-icon/lib/main.js
addon-sdk/source/python-lib/cuddlefish/tests/bug-588119-files/packages/implicit-icon/package.json
addon-sdk/source/python-lib/cuddlefish/tests/bug-588119-files/packages/no-icon/lib/main.js
addon-sdk/source/python-lib/cuddlefish/tests/bug-588119-files/packages/no-icon/package.json
addon-sdk/source/python-lib/cuddlefish/tests/bug-588661-files/packages/bar/lib/bar-loader.js
addon-sdk/source/python-lib/cuddlefish/tests/bug-588661-files/packages/bar/package.json
addon-sdk/source/python-lib/cuddlefish/tests/bug-588661-files/packages/foo/lib/foo-loader.js
addon-sdk/source/python-lib/cuddlefish/tests/bug-588661-files/packages/foo/package.json
addon-sdk/source/python-lib/cuddlefish/tests/bug-611495-files/jspath-one/docs/main.md
addon-sdk/source/python-lib/cuddlefish/tests/bug-611495-files/jspath-one/lib/main.js
addon-sdk/source/python-lib/cuddlefish/tests/bug-611495-files/jspath-one/package.json
addon-sdk/source/python-lib/cuddlefish/tests/bug-614712-files/packages/commonjs-naming/doc/foo.md
addon-sdk/source/python-lib/cuddlefish/tests/bug-614712-files/packages/commonjs-naming/lib/foo-loader.js
addon-sdk/source/python-lib/cuddlefish/tests/bug-614712-files/packages/commonjs-naming/package.json
addon-sdk/source/python-lib/cuddlefish/tests/bug-614712-files/packages/commonjs-naming/test/test-foo.js
addon-sdk/source/python-lib/cuddlefish/tests/bug-614712-files/packages/original-naming/docs/foo.md
addon-sdk/source/python-lib/cuddlefish/tests/bug-614712-files/packages/original-naming/lib/foo-loader.js
addon-sdk/source/python-lib/cuddlefish/tests/bug-614712-files/packages/original-naming/package.json
addon-sdk/source/python-lib/cuddlefish/tests/bug-614712-files/packages/original-naming/tests/test-foo.js
addon-sdk/source/python-lib/cuddlefish/tests/bug-652227-files/packages/default-lib/doc/foo.md
addon-sdk/source/python-lib/cuddlefish/tests/bug-652227-files/packages/default-lib/lib/foo.js
addon-sdk/source/python-lib/cuddlefish/tests/bug-652227-files/packages/default-lib/lib/loader.js
addon-sdk/source/python-lib/cuddlefish/tests/bug-652227-files/packages/default-lib/package.json
addon-sdk/source/python-lib/cuddlefish/tests/bug-652227-files/packages/default-lib/test/test-foo.js
addon-sdk/source/python-lib/cuddlefish/tests/bug-652227-files/packages/default-locale/locale/emptyFolder
addon-sdk/source/python-lib/cuddlefish/tests/bug-652227-files/packages/default-locale/package.json
addon-sdk/source/python-lib/cuddlefish/tests/bug-652227-files/packages/default-root/doc/foo.md
addon-sdk/source/python-lib/cuddlefish/tests/bug-652227-files/packages/default-root/foo.js
addon-sdk/source/python-lib/cuddlefish/tests/bug-652227-files/packages/default-root/loader.js
addon-sdk/source/python-lib/cuddlefish/tests/bug-652227-files/packages/default-root/package.json
addon-sdk/source/python-lib/cuddlefish/tests/bug-652227-files/packages/default-root/test/test-foo.js
addon-sdk/source/python-lib/cuddlefish/tests/bug-652227-files/packages/explicit-dir-lib/alt-lib/foo.js
addon-sdk/source/python-lib/cuddlefish/tests/bug-652227-files/packages/explicit-dir-lib/alt-lib/loader.js
addon-sdk/source/python-lib/cuddlefish/tests/bug-652227-files/packages/explicit-dir-lib/doc/foo.md
addon-sdk/source/python-lib/cuddlefish/tests/bug-652227-files/packages/explicit-dir-lib/package.json
addon-sdk/source/python-lib/cuddlefish/tests/bug-652227-files/packages/explicit-dir-lib/test/test-foo.js
addon-sdk/source/python-lib/cuddlefish/tests/bug-652227-files/packages/explicit-lib/alt2-lib/foo.js
addon-sdk/source/python-lib/cuddlefish/tests/bug-652227-files/packages/explicit-lib/alt2-lib/loader.js
addon-sdk/source/python-lib/cuddlefish/tests/bug-652227-files/packages/explicit-lib/doc/foo.md
addon-sdk/source/python-lib/cuddlefish/tests/bug-652227-files/packages/explicit-lib/package.json
addon-sdk/source/python-lib/cuddlefish/tests/bug-652227-files/packages/explicit-lib/test/test-foo.js
addon-sdk/source/python-lib/cuddlefish/tests/bug-669274-files/packages/extra-options/docs/main.md
addon-sdk/source/python-lib/cuddlefish/tests/bug-669274-files/packages/extra-options/lib/main.js
addon-sdk/source/python-lib/cuddlefish/tests/bug-669274-files/packages/extra-options/package.json
addon-sdk/source/python-lib/cuddlefish/tests/bug-715340-files/pkg-1-pack/package.json
addon-sdk/source/python-lib/cuddlefish/tests/bug-715340-files/pkg-2-unpack/package.json
addon-sdk/source/python-lib/cuddlefish/tests/bug-715340-files/pkg-3-pack/package.json
addon-sdk/source/python-lib/cuddlefish/tests/bug-906359-files/fullName/package.json
addon-sdk/source/python-lib/cuddlefish/tests/bug-906359-files/none/package.json
addon-sdk/source/python-lib/cuddlefish/tests/bug-906359-files/title/package.json
addon-sdk/source/python-lib/cuddlefish/tests/e10s-adapter-files/packages/foo/lib/bar-e10s-adapter.js
addon-sdk/source/python-lib/cuddlefish/tests/e10s-adapter-files/packages/foo/lib/bar.js
addon-sdk/source/python-lib/cuddlefish/tests/e10s-adapter-files/packages/foo/lib/foo.js
addon-sdk/source/python-lib/cuddlefish/tests/e10s-adapter-files/packages/foo/package.json
addon-sdk/source/python-lib/cuddlefish/tests/linker-files/five/lib/main.js
addon-sdk/source/python-lib/cuddlefish/tests/linker-files/five/package.json
addon-sdk/source/python-lib/cuddlefish/tests/linker-files/four-deps/four-a/lib/misc.js
addon-sdk/source/python-lib/cuddlefish/tests/linker-files/four-deps/four-a/package.json
addon-sdk/source/python-lib/cuddlefish/tests/linker-files/four-deps/four-a/topfiles/main.js
addon-sdk/source/python-lib/cuddlefish/tests/linker-files/four/lib/main.js
addon-sdk/source/python-lib/cuddlefish/tests/linker-files/four/package.json
addon-sdk/source/python-lib/cuddlefish/tests/linker-files/one/lib/main.js
addon-sdk/source/python-lib/cuddlefish/tests/linker-files/one/lib/subdir/three.js
addon-sdk/source/python-lib/cuddlefish/tests/linker-files/one/lib/two.js
addon-sdk/source/python-lib/cuddlefish/tests/linker-files/one/package.json
addon-sdk/source/python-lib/cuddlefish/tests/linker-files/seven/data/text.data
addon-sdk/source/python-lib/cuddlefish/tests/linker-files/seven/lib/main.js
addon-sdk/source/python-lib/cuddlefish/tests/linker-files/seven/lib/unused.js
addon-sdk/source/python-lib/cuddlefish/tests/linker-files/seven/package.json
addon-sdk/source/python-lib/cuddlefish/tests/linker-files/six/lib/unused.js
addon-sdk/source/python-lib/cuddlefish/tests/linker-files/six/package.json
addon-sdk/source/python-lib/cuddlefish/tests/linker-files/six/unreachable.js
addon-sdk/source/python-lib/cuddlefish/tests/linker-files/three-deps/three-a/lib/main.js
addon-sdk/source/python-lib/cuddlefish/tests/linker-files/three-deps/three-a/lib/subdir/subfile.js
addon-sdk/source/python-lib/cuddlefish/tests/linker-files/three-deps/three-a/lib/unused.js
addon-sdk/source/python-lib/cuddlefish/tests/linker-files/three-deps/three-a/locale/fr-FR.properties
addon-sdk/source/python-lib/cuddlefish/tests/linker-files/three-deps/three-a/package.json
addon-sdk/source/python-lib/cuddlefish/tests/linker-files/three-deps/three-b/lib/main.js
addon-sdk/source/python-lib/cuddlefish/tests/linker-files/three-deps/three-b/locale/fr-FR.properties
addon-sdk/source/python-lib/cuddlefish/tests/linker-files/three-deps/three-b/package.json
addon-sdk/source/python-lib/cuddlefish/tests/linker-files/three-deps/three-c/lib/main.js
addon-sdk/source/python-lib/cuddlefish/tests/linker-files/three-deps/three-c/lib/sub/foo.js
addon-sdk/source/python-lib/cuddlefish/tests/linker-files/three-deps/three-c/locale/fr-FR.properties
addon-sdk/source/python-lib/cuddlefish/tests/linker-files/three-deps/three-c/package.json
addon-sdk/source/python-lib/cuddlefish/tests/linker-files/three/data/msg.txt
addon-sdk/source/python-lib/cuddlefish/tests/linker-files/three/data/subdir/submsg.txt
addon-sdk/source/python-lib/cuddlefish/tests/linker-files/three/lib/main.js
addon-sdk/source/python-lib/cuddlefish/tests/linker-files/three/package.json
addon-sdk/source/python-lib/cuddlefish/tests/linker-files/three/tests/nontest.js
addon-sdk/source/python-lib/cuddlefish/tests/linker-files/three/tests/test-one.js
addon-sdk/source/python-lib/cuddlefish/tests/linker-files/three/tests/test-two.js
addon-sdk/source/python-lib/cuddlefish/tests/static-files/packages/aardvark/doc/main.md
addon-sdk/source/python-lib/cuddlefish/tests/static-files/packages/aardvark/lib/ignore_me
addon-sdk/source/python-lib/cuddlefish/tests/static-files/packages/aardvark/lib/main.js
addon-sdk/source/python-lib/cuddlefish/tests/static-files/packages/aardvark/lib/surprise.js/ignore_me_too
addon-sdk/source/python-lib/cuddlefish/tests/static-files/packages/aardvark/package.json
addon-sdk/source/python-lib/cuddlefish/tests/static-files/packages/anteater_files/lib/main.js
addon-sdk/source/python-lib/cuddlefish/tests/static-files/packages/anteater_files/package.json
addon-sdk/source/python-lib/cuddlefish/tests/static-files/packages/api-utils/lib/loader.js
addon-sdk/source/python-lib/cuddlefish/tests/static-files/packages/api-utils/package.json
addon-sdk/source/python-lib/cuddlefish/tests/static-files/packages/barbeque/lib/bar-module.js
addon-sdk/source/python-lib/cuddlefish/tests/static-files/packages/barbeque/package.json
addon-sdk/source/python-lib/cuddlefish/tests/static-files/packages/minimal/lib/main.js
addon-sdk/source/python-lib/cuddlefish/tests/static-files/packages/minimal/package.json
addon-sdk/source/python-lib/cuddlefish/tests/static-files/packages/third_party/docs/third_party.md
addon-sdk/source/python-lib/cuddlefish/tests/static-files/packages/third_party/lib/third-party.js
addon-sdk/source/python-lib/cuddlefish/tests/static-files/packages/third_party/package.json
addon-sdk/source/python-lib/cuddlefish/tests/static-files/xpi-template/components/harness.js
addon-sdk/source/python-lib/cuddlefish/tests/test_init.py
addon-sdk/source/python-lib/cuddlefish/tests/test_licenses.py
addon-sdk/source/python-lib/cuddlefish/tests/test_linker.py
addon-sdk/source/python-lib/cuddlefish/tests/test_manifest.py
addon-sdk/source/python-lib/cuddlefish/tests/test_packaging.py
addon-sdk/source/python-lib/cuddlefish/tests/test_preflight.py
addon-sdk/source/python-lib/cuddlefish/tests/test_property_parser.py
addon-sdk/source/python-lib/cuddlefish/tests/test_rdf.py
addon-sdk/source/python-lib/cuddlefish/tests/test_runner.py
addon-sdk/source/python-lib/cuddlefish/tests/test_util.py
addon-sdk/source/python-lib/cuddlefish/tests/test_version.py
addon-sdk/source/python-lib/cuddlefish/tests/test_xpi.py
addon-sdk/source/python-lib/cuddlefish/util.py
addon-sdk/source/python-lib/cuddlefish/version_comparator.py
addon-sdk/source/python-lib/cuddlefish/xpi.py
addon-sdk/source/python-lib/jetpack_sdk_env.py
addon-sdk/source/python-lib/mozrunner/__init__.py
addon-sdk/source/python-lib/mozrunner/killableprocess.py
addon-sdk/source/python-lib/mozrunner/qijo.py
addon-sdk/source/python-lib/mozrunner/winprocess.py
addon-sdk/source/python-lib/mozrunner/wpk.py
addon-sdk/source/python-lib/plural-rules-generator.py
addon-sdk/source/python-lib/simplejson/LICENSE.txt
addon-sdk/source/python-lib/simplejson/__init__.py
addon-sdk/source/python-lib/simplejson/decoder.py
addon-sdk/source/python-lib/simplejson/encoder.py
addon-sdk/source/python-lib/simplejson/scanner.py
addon-sdk/source/python-lib/simplejson/tool.py
addon-sdk/source/test/addons/addon-manager/lib/main.js
addon-sdk/source/test/addons/addon-manager/lib/test-main.js
addon-sdk/source/test/addons/addon-manager/package.json
addon-sdk/source/test/addons/author-email/main.js
addon-sdk/source/test/addons/author-email/package.json
addon-sdk/source/test/addons/child_process/index.js
addon-sdk/source/test/addons/child_process/package.json
addon-sdk/source/test/addons/chrome/chrome.manifest
addon-sdk/source/test/addons/chrome/chrome/content/new-window.xul
addon-sdk/source/test/addons/chrome/chrome/content/panel.html
addon-sdk/source/test/addons/chrome/chrome/locale/en-US/description.properties
addon-sdk/source/test/addons/chrome/chrome/locale/ja-JP/description.properties
addon-sdk/source/test/addons/chrome/chrome/skin/style.css
addon-sdk/source/test/addons/chrome/data/panel.js
addon-sdk/source/test/addons/chrome/main.js
addon-sdk/source/test/addons/chrome/package.json
addon-sdk/source/test/addons/content-permissions/httpd.js
addon-sdk/source/test/addons/content-permissions/main.js
addon-sdk/source/test/addons/content-permissions/package.json
addon-sdk/source/test/addons/content-script-messages-latency/httpd.js
addon-sdk/source/test/addons/content-script-messages-latency/main.js
addon-sdk/source/test/addons/content-script-messages-latency/package.json
addon-sdk/source/test/addons/contributors/main.js
addon-sdk/source/test/addons/contributors/package.json
addon-sdk/source/test/addons/curly-id/lib/main.js
addon-sdk/source/test/addons/curly-id/package.json
addon-sdk/source/test/addons/developers/main.js
addon-sdk/source/test/addons/developers/package.json
addon-sdk/source/test/addons/e10s-content/data/test-contentScriptFile.js
addon-sdk/source/test/addons/e10s-content/data/test-page-worker.html
addon-sdk/source/test/addons/e10s-content/data/test-page-worker.js
addon-sdk/source/test/addons/e10s-content/data/test.html
addon-sdk/source/test/addons/e10s-content/lib/fixtures.js
addon-sdk/source/test/addons/e10s-content/lib/httpd.js
addon-sdk/source/test/addons/e10s-content/lib/main.js
addon-sdk/source/test/addons/e10s-content/lib/test-content-script.js
addon-sdk/source/test/addons/e10s-content/lib/test-content-worker.js
addon-sdk/source/test/addons/e10s-content/lib/test-page-worker.js
addon-sdk/source/test/addons/e10s-content/package.json
addon-sdk/source/test/addons/e10s-l10n/data/test-localization.html
addon-sdk/source/test/addons/e10s-l10n/locale/en.properties
addon-sdk/source/test/addons/e10s-l10n/locale/eo.properties
addon-sdk/source/test/addons/e10s-l10n/locale/fr-FR.properties
addon-sdk/source/test/addons/e10s-l10n/main.js
addon-sdk/source/test/addons/e10s-l10n/package.json
addon-sdk/source/test/addons/e10s-remote/main.js
addon-sdk/source/test/addons/e10s-remote/package.json
addon-sdk/source/test/addons/e10s-remote/remote-module.js
addon-sdk/source/test/addons/e10s-remote/utils.js
addon-sdk/source/test/addons/e10s-tabs/lib/main.js
addon-sdk/source/test/addons/e10s-tabs/lib/private-browsing/helper.js
addon-sdk/source/test/addons/e10s-tabs/lib/test-tab-events.js
addon-sdk/source/test/addons/e10s-tabs/lib/test-tab-observer.js
addon-sdk/source/test/addons/e10s-tabs/lib/test-tab-utils.js
addon-sdk/source/test/addons/e10s-tabs/lib/test-tab.js
addon-sdk/source/test/addons/e10s-tabs/package.json
addon-sdk/source/test/addons/e10s/lib/main.js
addon-sdk/source/test/addons/e10s/package.json
addon-sdk/source/test/addons/embedded-webextension/main.js
addon-sdk/source/test/addons/embedded-webextension/package.json
addon-sdk/source/test/addons/embedded-webextension/webextension/background-page.js
addon-sdk/source/test/addons/embedded-webextension/webextension/content-script.js
addon-sdk/source/test/addons/embedded-webextension/webextension/manifest.json
addon-sdk/source/test/addons/jetpack-addon.ini
addon-sdk/source/test/addons/l10n-properties/app-extension/application.ini
addon-sdk/source/test/addons/l10n-properties/app-extension/bootstrap.js
addon-sdk/source/test/addons/l10n-properties/app-extension/install.rdf
addon-sdk/source/test/addons/l10n-properties/app-extension/locale/en-GB.properties
addon-sdk/source/test/addons/l10n-properties/app-extension/locale/en-US.properties
addon-sdk/source/test/addons/l10n-properties/app-extension/locale/eo.properties
addon-sdk/source/test/addons/l10n-properties/app-extension/locale/fr-FR.properties
addon-sdk/source/test/addons/l10n-properties/data/test-localization.html
addon-sdk/source/test/addons/l10n-properties/main.js
addon-sdk/source/test/addons/l10n-properties/package.json
addon-sdk/source/test/addons/l10n/data/test-localization.html
addon-sdk/source/test/addons/l10n/locale/en.properties
addon-sdk/source/test/addons/l10n/locale/eo.properties
addon-sdk/source/test/addons/l10n/locale/fr-FR.properties
addon-sdk/source/test/addons/l10n/main.js
addon-sdk/source/test/addons/l10n/package.json
addon-sdk/source/test/addons/layout-change/lib/main.js
addon-sdk/source/test/addons/layout-change/lib/test-cuddlefish-loader.js
addon-sdk/source/test/addons/layout-change/lib/test-toolkit-loader.js
addon-sdk/source/test/addons/layout-change/package.json
addon-sdk/source/test/addons/main/main.js
addon-sdk/source/test/addons/main/package.json
addon-sdk/source/test/addons/name-in-numbers-plus/index.js
addon-sdk/source/test/addons/name-in-numbers-plus/package.json
addon-sdk/source/test/addons/name-in-numbers/index.js
addon-sdk/source/test/addons/name-in-numbers/package.json
addon-sdk/source/test/addons/packaging/main.js
addon-sdk/source/test/addons/packaging/package.json
addon-sdk/source/test/addons/packed/main.js
addon-sdk/source/test/addons/packed/package.json
addon-sdk/source/test/addons/page-mod-debugger-post/data/index.html
addon-sdk/source/test/addons/page-mod-debugger-post/data/script.js
addon-sdk/source/test/addons/page-mod-debugger-post/main.js
addon-sdk/source/test/addons/page-mod-debugger-post/package.json
addon-sdk/source/test/addons/page-mod-debugger-pre/data/index.html
addon-sdk/source/test/addons/page-mod-debugger-pre/data/script.js
addon-sdk/source/test/addons/page-mod-debugger-pre/main.js
addon-sdk/source/test/addons/page-mod-debugger-pre/package.json
addon-sdk/source/test/addons/page-worker/data/page.html
addon-sdk/source/test/addons/page-worker/data/page.js
addon-sdk/source/test/addons/page-worker/main.js
addon-sdk/source/test/addons/page-worker/package.json
addon-sdk/source/test/addons/places/lib/favicon-helpers.js
addon-sdk/source/test/addons/places/lib/httpd.js
addon-sdk/source/test/addons/places/lib/main.js
addon-sdk/source/test/addons/places/lib/places-helper.js
addon-sdk/source/test/addons/places/lib/test-places-bookmarks.js
addon-sdk/source/test/addons/places/lib/test-places-events.js
addon-sdk/source/test/addons/places/lib/test-places-favicon.js
addon-sdk/source/test/addons/places/lib/test-places-history.js
addon-sdk/source/test/addons/places/lib/test-places-host.js
addon-sdk/source/test/addons/places/lib/test-places-utils.js
addon-sdk/source/test/addons/places/package.json
addon-sdk/source/test/addons/predefined-id-with-at/lib/main.js
addon-sdk/source/test/addons/predefined-id-with-at/package.json
addon-sdk/source/test/addons/preferences-branch/lib/main.js
addon-sdk/source/test/addons/preferences-branch/package.json
addon-sdk/source/test/addons/private-browsing-supported/main.js
addon-sdk/source/test/addons/private-browsing-supported/package.json
addon-sdk/source/test/addons/private-browsing-supported/sidebar/utils.js
addon-sdk/source/test/addons/private-browsing-supported/test-page-mod.js
addon-sdk/source/test/addons/private-browsing-supported/test-panel.js
addon-sdk/source/test/addons/private-browsing-supported/test-private-browsing.js
addon-sdk/source/test/addons/private-browsing-supported/test-selection.js
addon-sdk/source/test/addons/private-browsing-supported/test-sidebar.js
addon-sdk/source/test/addons/private-browsing-supported/test-tabs.js
addon-sdk/source/test/addons/private-browsing-supported/test-window-tabs.js
addon-sdk/source/test/addons/private-browsing-supported/test-windows.js
addon-sdk/source/test/addons/remote/main.js
addon-sdk/source/test/addons/remote/package.json
addon-sdk/source/test/addons/remote/remote-module.js
addon-sdk/source/test/addons/remote/utils.js
addon-sdk/source/test/addons/require/list.js
addon-sdk/source/test/addons/require/main.js
addon-sdk/source/test/addons/require/multiple/a.js
addon-sdk/source/test/addons/require/multiple/b.js
addon-sdk/source/test/addons/require/package.json
addon-sdk/source/test/addons/require/packages/tabs/main.js
addon-sdk/source/test/addons/require/packages/tabs/package.json
addon-sdk/source/test/addons/require/packages/tabs/page-mod.js
addon-sdk/source/test/addons/require/same-folder.js
addon-sdk/source/test/addons/require/sub-folder/module.js
addon-sdk/source/test/addons/require/tabs.js
addon-sdk/source/test/addons/self/data/data.md
addon-sdk/source/test/addons/self/main.js
addon-sdk/source/test/addons/self/package.json
addon-sdk/source/test/addons/simple-prefs-l10n/locale/en.properties
addon-sdk/source/test/addons/simple-prefs-l10n/main.js
addon-sdk/source/test/addons/simple-prefs-l10n/package.json
addon-sdk/source/test/addons/simple-prefs-regression/app-extension/application.ini
addon-sdk/source/test/addons/simple-prefs-regression/app-extension/bootstrap.js
addon-sdk/source/test/addons/simple-prefs-regression/app-extension/defaults/preferences/prefs.js
addon-sdk/source/test/addons/simple-prefs-regression/app-extension/install.rdf
addon-sdk/source/test/addons/simple-prefs-regression/app-extension/options.xul
addon-sdk/source/test/addons/simple-prefs-regression/lib/main.js
addon-sdk/source/test/addons/simple-prefs-regression/package.json
addon-sdk/source/test/addons/simple-prefs/lib/main.js
addon-sdk/source/test/addons/simple-prefs/package.json
addon-sdk/source/test/addons/standard-id/lib/main.js
addon-sdk/source/test/addons/standard-id/package.json
addon-sdk/source/test/addons/tab-close-on-startup/main.js
addon-sdk/source/test/addons/tab-close-on-startup/package.json
addon-sdk/source/test/addons/toolkit-require-reload/main.js
addon-sdk/source/test/addons/toolkit-require-reload/package.json
addon-sdk/source/test/addons/translators/main.js
addon-sdk/source/test/addons/translators/package.json
addon-sdk/source/test/addons/unsafe-content-script/main.js
addon-sdk/source/test/addons/unsafe-content-script/package.json
addon-sdk/source/test/buffers/test-read-types.js
addon-sdk/source/test/buffers/test-write-types.js
addon-sdk/source/test/commonjs-test-adapter/asserts.js
addon-sdk/source/test/context-menu/framescript.js
addon-sdk/source/test/context-menu/test-helper.js
addon-sdk/source/test/context-menu/util.js
addon-sdk/source/test/event/helpers.js
addon-sdk/source/test/fixtures.js
addon-sdk/source/test/fixtures/addon-install-unit-test@mozilla.com.xpi
addon-sdk/source/test/fixtures/addon-sdk/data/border-style.css
addon-sdk/source/test/fixtures/addon-sdk/data/test-contentScriptFile.js
addon-sdk/source/test/fixtures/addon-sdk/data/test-page-worker.html
addon-sdk/source/test/fixtures/addon-sdk/data/test-page-worker.js
addon-sdk/source/test/fixtures/addon-sdk/data/test.html
addon-sdk/source/test/fixtures/addon/bootstrap.js
addon-sdk/source/test/fixtures/addon/index.js
addon-sdk/source/test/fixtures/addon/package.json
addon-sdk/source/test/fixtures/bootstrap-addon/META-INF/manifest.mf
addon-sdk/source/test/fixtures/bootstrap-addon/META-INF/mozilla.rsa
addon-sdk/source/test/fixtures/bootstrap-addon/META-INF/mozilla.sf
addon-sdk/source/test/fixtures/bootstrap-addon/bootstrap.js
addon-sdk/source/test/fixtures/bootstrap-addon/install.rdf
addon-sdk/source/test/fixtures/bootstrap-addon/options.xul
addon-sdk/source/test/fixtures/bootstrap/utils.js
addon-sdk/source/test/fixtures/border-style.css
addon-sdk/source/test/fixtures/child-process-scripts.js
addon-sdk/source/test/fixtures/chrome-worker/addEventListener.js
addon-sdk/source/test/fixtures/chrome-worker/jsctypes.js
addon-sdk/source/test/fixtures/chrome-worker/onerror.js
addon-sdk/source/test/fixtures/chrome-worker/onmessage.js
addon-sdk/source/test/fixtures/chrome-worker/setTimeout.js
addon-sdk/source/test/fixtures/chrome-worker/xhr.js
addon-sdk/source/test/fixtures/create_xpi.py
addon-sdk/source/test/fixtures/es5.js
addon-sdk/source/test/fixtures/include-file.css
addon-sdk/source/test/fixtures/index.html
addon-sdk/source/test/fixtures/jsm-package/Test.jsm
addon-sdk/source/test/fixtures/jsm-package/index.js
addon-sdk/source/test/fixtures/jsm-package/package.json
addon-sdk/source/test/fixtures/loader/cycles/a.js
addon-sdk/source/test/fixtures/loader/cycles/b.js
addon-sdk/source/test/fixtures/loader/cycles/c.js
addon-sdk/source/test/fixtures/loader/cycles/main.js
addon-sdk/source/test/fixtures/loader/errors/boomer.js
addon-sdk/source/test/fixtures/loader/errors/main.js
addon-sdk/source/test/fixtures/loader/exceptions/boomer.js
addon-sdk/source/test/fixtures/loader/exceptions/main.js
addon-sdk/source/test/fixtures/loader/globals/main.js
addon-sdk/source/test/fixtures/loader/json/invalid.json
addon-sdk/source/test/fixtures/loader/json/manifest.json
addon-sdk/source/test/fixtures/loader/json/mutation.json
addon-sdk/source/test/fixtures/loader/json/nodotjson.json.js
addon-sdk/source/test/fixtures/loader/json/test.json
addon-sdk/source/test/fixtures/loader/json/test.json.js
addon-sdk/source/test/fixtures/loader/lazy/main.js
addon-sdk/source/test/fixtures/loader/missing-twice/file.json
addon-sdk/source/test/fixtures/loader/missing-twice/main.js
addon-sdk/source/test/fixtures/loader/missing/main.js
addon-sdk/source/test/fixtures/loader/self/main.js
addon-sdk/source/test/fixtures/loader/syntax-error/error.js
addon-sdk/source/test/fixtures/loader/syntax-error/main.js
addon-sdk/source/test/fixtures/loader/unsupported/fennec.js
addon-sdk/source/test/fixtures/loader/unsupported/firefox.js
addon-sdk/source/test/fixtures/mofo_logo.SVG
addon-sdk/source/test/fixtures/moz.build
addon-sdk/source/test/fixtures/moz_favicon.ico
addon-sdk/source/test/fixtures/native-addon-test/dir/a.js
addon-sdk/source/test/fixtures/native-addon-test/dir/a/index.js
addon-sdk/source/test/fixtures/native-addon-test/dir/b.js
addon-sdk/source/test/fixtures/native-addon-test/dir/c.js
addon-sdk/source/test/fixtures/native-addon-test/dir/dummy.js
addon-sdk/source/test/fixtures/native-addon-test/dir/test.jsm
addon-sdk/source/test/fixtures/native-addon-test/expectedmap.json
addon-sdk/source/test/fixtures/native-addon-test/index.js
addon-sdk/source/test/fixtures/native-addon-test/newmodule/index.js
addon-sdk/source/test/fixtures/native-addon-test/newmodule/lib/file.js
addon-sdk/source/test/fixtures/native-addon-test/newmodule/package.json
addon-sdk/source/test/fixtures/native-addon-test/node_modules/test-assets/index.js
addon-sdk/source/test/fixtures/native-addon-test/node_modules/test-assets/package.json
addon-sdk/source/test/fixtures/native-addon-test/node_modules/test-assets/styles.css
addon-sdk/source/test/fixtures/native-addon-test/node_modules/test-custom-main-relative/lib/custom-entry.js
addon-sdk/source/test/fixtures/native-addon-test/node_modules/test-custom-main-relative/package.json
addon-sdk/source/test/fixtures/native-addon-test/node_modules/test-custom-main/lib/custom-entry.js
addon-sdk/source/test/fixtures/native-addon-test/node_modules/test-custom-main/package.json
addon-sdk/source/test/fixtures/native-addon-test/node_modules/test-default-main/index.js
addon-sdk/source/test/fixtures/native-addon-test/node_modules/test-default-main/package.json
addon-sdk/source/test/fixtures/native-addon-test/node_modules/test-math/index.js
addon-sdk/source/test/fixtures/native-addon-test/node_modules/test-math/lib/sqrt.js
addon-sdk/source/test/fixtures/native-addon-test/node_modules/test-math/node_modules/test-add/index.js
addon-sdk/source/test/fixtures/native-addon-test/node_modules/test-math/node_modules/test-add/package.json
addon-sdk/source/test/fixtures/native-addon-test/node_modules/test-math/node_modules/test-subtract/index.js
addon-sdk/source/test/fixtures/native-addon-test/node_modules/test-math/node_modules/test-subtract/package.json
addon-sdk/source/test/fixtures/native-addon-test/node_modules/test-math/package.json
addon-sdk/source/test/fixtures/native-addon-test/package.json
addon-sdk/source/test/fixtures/native-addon-test/utils/index.js
addon-sdk/source/test/fixtures/native-overrides-test/ignore.js
addon-sdk/source/test/fixtures/native-overrides-test/index.js
addon-sdk/source/test/fixtures/native-overrides-test/lib/ignore.js
addon-sdk/source/test/fixtures/native-overrides-test/lib/internal.js
addon-sdk/source/test/fixtures/native-overrides-test/lib/tabs.js
addon-sdk/source/test/fixtures/native-overrides-test/node_modules/cool-tabs/index.js
addon-sdk/source/test/fixtures/native-overrides-test/node_modules/cool-tabs/lib/tabs.js
addon-sdk/source/test/fixtures/native-overrides-test/node_modules/cool-tabs/package.json
addon-sdk/source/test/fixtures/native-overrides-test/node_modules/foo/index.js
addon-sdk/source/test/fixtures/native-overrides-test/node_modules/foo/lib/foo.js
addon-sdk/source/test/fixtures/native-overrides-test/node_modules/foo/node_modules/bar/index.js
addon-sdk/source/test/fixtures/native-overrides-test/node_modules/foo/node_modules/bar/package.json
addon-sdk/source/test/fixtures/native-overrides-test/node_modules/foo/package.json
addon-sdk/source/test/fixtures/native-overrides-test/node_modules/fs-extra/index.js
addon-sdk/source/test/fixtures/native-overrides-test/node_modules/fs-extra/package.json
addon-sdk/source/test/fixtures/native-overrides-test/package.json
addon-sdk/source/test/fixtures/preferences/curly-id/package.json
addon-sdk/source/test/fixtures/preferences/no-prefs/package.json
addon-sdk/source/test/fixtures/preferences/preferences-branch/package.json
addon-sdk/source/test/fixtures/preferences/simple-prefs/package.json
addon-sdk/source/test/fixtures/sandbox-complex-character.js
addon-sdk/source/test/fixtures/sandbox-normal.js
addon-sdk/source/test/fixtures/test-addon-extras-window.html
addon-sdk/source/test/fixtures/test-addon-extras.html
addon-sdk/source/test/fixtures/test-contentScriptFile.js
addon-sdk/source/test/fixtures/test-context-menu.js
addon-sdk/source/test/fixtures/test-iframe-postmessage.html
addon-sdk/source/test/fixtures/test-iframe.html
addon-sdk/source/test/fixtures/test-iframe.js
addon-sdk/source/test/fixtures/test-message-manager.js
addon-sdk/source/test/fixtures/test-net-url.txt
addon-sdk/source/test/fixtures/test-page-mod.html
addon-sdk/source/test/fixtures/test-sidebar-addon-global.html
addon-sdk/source/test/fixtures/test-trusted-document.html
addon-sdk/source/test/fixtures/test.html
addon-sdk/source/test/fixtures/testLocalXhr.json
addon-sdk/source/test/framescript-manager/frame-script.js
addon-sdk/source/test/framescript-manager/pong.js
addon-sdk/source/test/framescript-util/frame-script.js
addon-sdk/source/test/jetpack-package.ini
addon-sdk/source/test/leak/jetpack-package.ini
addon-sdk/source/test/leak/leak-utils.js
addon-sdk/source/test/leak/test-leak-event-dom-closed-window.js
addon-sdk/source/test/leak/test-leak-tab-events.js
addon-sdk/source/test/leak/test-leak-window-events.js
addon-sdk/source/test/lib/httpd.js
addon-sdk/source/test/loader/b2g.js
addon-sdk/source/test/loader/fixture.js
addon-sdk/source/test/loader/user-global.js
addon-sdk/source/test/modules/add.js
addon-sdk/source/test/modules/async1.js
addon-sdk/source/test/modules/async2.js
addon-sdk/source/test/modules/badExportAndReturn.js
addon-sdk/source/test/modules/badFirst.js
addon-sdk/source/test/modules/badSecond.js
addon-sdk/source/test/modules/blue.js
addon-sdk/source/test/modules/castor.js
addon-sdk/source/test/modules/cheetah.js
addon-sdk/source/test/modules/color.js
addon-sdk/source/test/modules/dupe.js
addon-sdk/source/test/modules/dupeNested.js
addon-sdk/source/test/modules/dupeSetExports.js
addon-sdk/source/test/modules/exportsEquals.js
addon-sdk/source/test/modules/green.js
addon-sdk/source/test/modules/lion.js
addon-sdk/source/test/modules/orange.js
addon-sdk/source/test/modules/pollux.js
addon-sdk/source/test/modules/red.js
addon-sdk/source/test/modules/setExports.js
addon-sdk/source/test/modules/subtract.js
addon-sdk/source/test/modules/tiger.js
addon-sdk/source/test/modules/traditional1.js
addon-sdk/source/test/modules/traditional2.js
addon-sdk/source/test/modules/types/cat.js
addon-sdk/source/test/page-mod/helpers.js
addon-sdk/source/test/path/test-path.js
addon-sdk/source/test/preferences/common.json
addon-sdk/source/test/preferences/e10s-off.json
addon-sdk/source/test/preferences/e10s-on.json
addon-sdk/source/test/preferences/firefox.json
addon-sdk/source/test/preferences/no-connections.json
addon-sdk/source/test/preferences/test-e10s-preferences.js
addon-sdk/source/test/preferences/test-preferences.js
addon-sdk/source/test/preferences/test.json
addon-sdk/source/test/private-browsing/helper.js
addon-sdk/source/test/private-browsing/tabs.js
addon-sdk/source/test/private-browsing/windows.js
addon-sdk/source/test/querystring/test-querystring.js
addon-sdk/source/test/sidebar/utils.js
addon-sdk/source/test/tabs/test-fennec-tabs.js
addon-sdk/source/test/tabs/test-firefox-tabs.js
addon-sdk/source/test/tabs/utils.js
addon-sdk/source/test/test-addon-bootstrap.js
addon-sdk/source/test/test-addon-extras.js
addon-sdk/source/test/test-addon-installer.js
addon-sdk/source/test/test-addon-window.js
addon-sdk/source/test/test-api-utils.js
addon-sdk/source/test/test-array.js
addon-sdk/source/test/test-base64.js
addon-sdk/source/test/test-bootstrap.js
addon-sdk/source/test/test-browser-events.js
addon-sdk/source/test/test-buffer.js
addon-sdk/source/test/test-byte-streams.js
addon-sdk/source/test/test-child_process.js
addon-sdk/source/test/test-chrome.js
addon-sdk/source/test/test-clipboard.js
addon-sdk/source/test/test-collection.js
addon-sdk/source/test/test-commonjs-test-adapter.js
addon-sdk/source/test/test-content-events.js
addon-sdk/source/test/test-content-script.js
addon-sdk/source/test/test-content-sync-worker.js
addon-sdk/source/test/test-content-worker.js
addon-sdk/source/test/test-context-menu.html
addon-sdk/source/test/test-context-menu.js
addon-sdk/source/test/test-context-menu@2.js
addon-sdk/source/test/test-cuddlefish.js
addon-sdk/source/test/test-deprecate.js
addon-sdk/source/test/test-dev-panel.js
addon-sdk/source/test/test-diffpatcher.js
addon-sdk/source/test/test-dispatcher.js
addon-sdk/source/test/test-disposable.js
addon-sdk/source/test/test-dom.js
addon-sdk/source/test/test-environment.js
addon-sdk/source/test/test-event-core.js
addon-sdk/source/test/test-event-dom.js
addon-sdk/source/test/test-event-target.js
addon-sdk/source/test/test-event-utils.js
addon-sdk/source/test/test-file.js
addon-sdk/source/test/test-frame-utils.js
addon-sdk/source/test/test-framescript-manager.js
addon-sdk/source/test/test-framescript-util.js
addon-sdk/source/test/test-fs.js
addon-sdk/source/test/test-functional.js
addon-sdk/source/test/test-globals.js
addon-sdk/source/test/test-heritage.js
addon-sdk/source/test/test-hidden-frame.js
addon-sdk/source/test/test-host-events.js
addon-sdk/source/test/test-hotkeys.js
addon-sdk/source/test/test-httpd.js
addon-sdk/source/test/test-indexed-db.js
addon-sdk/source/test/test-jetpack-id.js
addon-sdk/source/test/test-keyboard-observer.js
addon-sdk/source/test/test-keyboard-utils.js
addon-sdk/source/test/test-l10n-locale.js
addon-sdk/source/test/test-l10n-plural-rules.js
addon-sdk/source/test/test-lang-type.js
addon-sdk/source/test/test-libxul.js
addon-sdk/source/test/test-list.js
addon-sdk/source/test/test-loader.js
addon-sdk/source/test/test-match-pattern.js
addon-sdk/source/test/test-method.js
addon-sdk/source/test/test-module.js
addon-sdk/source/test/test-modules.js
addon-sdk/source/test/test-mozilla-toolkit-versioning.js
addon-sdk/source/test/test-mpl2-license-header.js
addon-sdk/source/test/test-namespace.js
addon-sdk/source/test/test-native-loader.js
addon-sdk/source/test/test-native-options.js
addon-sdk/source/test/test-net-url.js
addon-sdk/source/test/test-node-os.js
addon-sdk/source/test/test-notifications.js
addon-sdk/source/test/test-object.js
addon-sdk/source/test/test-observers.js
addon-sdk/source/test/test-page-mod-debug.js
addon-sdk/source/test/test-page-mod.js
addon-sdk/source/test/test-page-worker.js
addon-sdk/source/test/test-panel.js
addon-sdk/source/test/test-passwords-utils.js
addon-sdk/source/test/test-passwords.js
addon-sdk/source/test/test-path.js
addon-sdk/source/test/test-plain-text-console.js
addon-sdk/source/test/test-preferences-service.js
addon-sdk/source/test/test-preferences-target.js
addon-sdk/source/test/test-private-browsing.js
addon-sdk/source/test/test-promise.js
addon-sdk/source/test/test-querystring.js
addon-sdk/source/test/test-reference.js
addon-sdk/source/test/test-request.js
addon-sdk/source/test/test-require.js
addon-sdk/source/test/test-rules.js
addon-sdk/source/test/test-sandbox.js
addon-sdk/source/test/test-selection.js
addon-sdk/source/test/test-self.js
addon-sdk/source/test/test-sequence.js
addon-sdk/source/test/test-set-exports.js
addon-sdk/source/test/test-shared-require.js
addon-sdk/source/test/test-simple-prefs.js
addon-sdk/source/test/test-simple-storage.js
addon-sdk/source/test/test-system-events.js
addon-sdk/source/test/test-system-input-output.js
addon-sdk/source/test/test-system-runtime.js
addon-sdk/source/test/test-system-startup.js
addon-sdk/source/test/test-system.js
addon-sdk/source/test/test-tab-events.js
addon-sdk/source/test/test-tab-observer.js
addon-sdk/source/test/test-tab-utils.js
addon-sdk/source/test/test-tab.js
addon-sdk/source/test/test-tabs-common.js
addon-sdk/source/test/test-tabs.js
addon-sdk/source/test/test-test-addon-file.js
addon-sdk/source/test/test-test-assert.js
addon-sdk/source/test/test-test-loader.js
addon-sdk/source/test/test-test-memory.js
addon-sdk/source/test/test-test-utils-async.js
addon-sdk/source/test/test-test-utils-generator.js
addon-sdk/source/test/test-test-utils-sync.js
addon-sdk/source/test/test-test-utils.js
addon-sdk/source/test/test-text-streams.js
addon-sdk/source/test/test-timer.js
addon-sdk/source/test/test-traceback.js
addon-sdk/source/test/test-ui-action-button.js
addon-sdk/source/test/test-ui-frame.js
addon-sdk/source/test/test-ui-id.js
addon-sdk/source/test/test-ui-sidebar-private-browsing.js
addon-sdk/source/test/test-ui-sidebar.js
addon-sdk/source/test/test-ui-toggle-button.js
addon-sdk/source/test/test-ui-toolbar.js
addon-sdk/source/test/test-unit-test-finder.js
addon-sdk/source/test/test-unit-test.js
addon-sdk/source/test/test-unload.js
addon-sdk/source/test/test-unsupported-skip.js
addon-sdk/source/test/test-uri-resource.js
addon-sdk/source/test/test-url.js
addon-sdk/source/test/test-uuid.js
addon-sdk/source/test/test-weak-set.js
addon-sdk/source/test/test-window-events.js
addon-sdk/source/test/test-window-observer.js
addon-sdk/source/test/test-window-utils-private-browsing.js
addon-sdk/source/test/test-window-utils.js
addon-sdk/source/test/test-window-utils2.js
addon-sdk/source/test/test-windows-common.js
addon-sdk/source/test/test-windows.js
addon-sdk/source/test/test-xhr.js
addon-sdk/source/test/test-xpcom.js
addon-sdk/source/test/test-xul-app.js
addon-sdk/source/test/traits/assert.js
addon-sdk/source/test/traits/utils.js
addon-sdk/source/test/util.js
addon-sdk/source/test/windows/test-fennec-windows.js
addon-sdk/source/test/windows/test-firefox-windows.js
addon-sdk/source/test/zip/utils.js
addon-sdk/test/Math.jsm
addon-sdk/test/browser.ini
addon-sdk/test/browser_sdk_loader_chrome.js
addon-sdk/test/browser_sdk_loader_chrome_in_sdk.js
addon-sdk/test/browser_sdk_loader_js_modules.js
addon-sdk/test/browser_sdk_loader_jsm_modules.js
addon-sdk/test/browser_sdk_loader_json.js
addon-sdk/test/browser_sdk_loader_sdk_gui_modules.js
addon-sdk/test/browser_sdk_loader_sdk_modules.js
addon-sdk/test/data.json
addon-sdk/test/head.js
addon-sdk/test/invalid.json
addon-sdk/test/math.js
dom/ipc/tests/file_cpow_cookies.html
dom/webauthn/NSSU2FTokenRemote.cpp
dom/webauthn/NSSU2FTokenRemote.h
js/src/jit-test/lib/range.js
layout/painting/nsDisplayList.cpp
security/manager/ssl/nsINSSU2FToken.idl
security/manager/ssl/nsIU2FToken.idl
security/manager/ssl/nsNSSU2FToken.cpp
security/manager/ssl/nsNSSU2FToken.h
testing/mochitest/jetpack-addon-harness.js
testing/mochitest/jetpack-addon-overlay.xul
testing/mochitest/jetpack-package-harness.js
testing/mochitest/jetpack-package-overlay.xul
toolkit/components/addoncompat/ShimWaiver.jsm
toolkit/components/osfile/tests/xpcshell/test_loader.js
toolkit/components/osfile/tests/xpcshell/test_loader/module_test_loader.js
--- a/.eslintignore
+++ b/.eslintignore
@@ -2,17 +2,16 @@
 **/node_modules/**/*.*
 
 # Exclude expected objdirs.
 obj*/**
 
 # We ignore all these directories by default, until we get them enabled.
 # If you are enabling a directory, please add directory specific exclusions
 # below.
-addon-sdk/**
 chrome/**
 config/**
 docshell/**
 editor/**
 embedding/**
 extensions/cookie/**
 extensions/spellcheck/**
 extensions/universalchardet/**
--- a/accessible/base/NotificationController.cpp
+++ b/accessible/base/NotificationController.cpp
@@ -804,17 +804,18 @@ NotificationController::WillRefresh(mozi
   }
 
   // Process invalidation list of the document after all accessible tree
   // modification are done.
   mDocument->ProcessInvalidationList();
 
   // Process relocation list.
   for (uint32_t idx = 0; idx < mRelocations.Length(); idx++) {
-    if (mRelocations[idx]->IsInDocument()) {
+    // owner should be in a document and have na associated DOM node (docs sometimes don't)
+    if (mRelocations[idx]->IsInDocument() && mRelocations[idx]->HasOwnContent()) {
       mDocument->DoARIAOwnsRelocation(mRelocations[idx]);
     }
   }
   mRelocations.Clear();
 
   // If a generic notification occurs after this point then we may be allowed to
   // process it synchronously.  However we do not want to reenter if fireing
   // events causes script to run.
--- a/accessible/generic/Accessible-inl.h
+++ b/accessible/generic/Accessible-inl.h
@@ -72,17 +72,17 @@ Accessible::SetRoleMapEntry(const nsRole
 
 inline bool
 Accessible::IsSearchbox() const
 {
   const nsRoleMapEntry* roleMapEntry = ARIARoleMap();
   return (roleMapEntry && roleMapEntry->Is(nsGkAtoms::searchbox)) ||
     (mContent->IsHTMLElement(nsGkAtoms::input) &&
      mContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::type,
-                           nsGkAtoms::textInputType, eCaseMatters));
+                           nsGkAtoms::search, eCaseMatters));
 }
 
 inline bool
 Accessible::HasGenericType(AccGenericType aType) const
 {
   const nsRoleMapEntry* roleMapEntry = ARIARoleMap();
   return (mGenericTypes & aType) ||
     (roleMapEntry && roleMapEntry->IsOfType(aType));
--- a/accessible/tests/browser/tree/browser_aria_owns.js
+++ b/accessible/tests/browser/tree/browser_aria_owns.js
@@ -142,8 +142,27 @@ addAccessibleTask(`
       // be in a good state and all is fine..
       document.getElementById("two").setAttribute("aria-owns", "a b");
     });
 
     testChildrenIds(one, ["c"]);
     testChildrenIds(two, ["a", "b"]);
   }
 );
+
+addAccessibleTask(`<div id="a"></div><div id="b"></div>`,
+  async function(browser, accDoc) {
+    testChildrenIds(accDoc, ["a", "b"]);
+
+    let waitFor = {
+      expected: [[ EVENT_REORDER, e => e.accessible == accDoc ]]
+    };
+
+    await contentSpawnMutation(browser, waitFor, function() {
+      document.documentElement.style.display = "none";
+      document.documentElement.getBoundingClientRect();
+      document.body.setAttribute("aria-owns", "b a");
+      document.documentElement.remove();
+    });
+
+    testChildrenIds(accDoc, []);
+  }
+);
--- a/accessible/xul/XULTreeAccessible.cpp
+++ b/accessible/xul/XULTreeAccessible.cpp
@@ -139,17 +139,17 @@ XULTreeAccessible::Value(nsString& aValu
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // XULTreeAccessible: Accessible implementation
 
 void
 XULTreeAccessible::Shutdown()
 {
-  if (!mDoc->IsDefunct()) {
+  if (mDoc && !mDoc->IsDefunct()) {
     UnbindCacheEntriesFromDocument(mAccessibleCache);
   }
 
   mTree = nullptr;
   mTreeView = nullptr;
 
   AccessibleWrap::Shutdown();
 }
--- a/accessible/xul/XULTreeGridAccessible.cpp
+++ b/accessible/xul/XULTreeGridAccessible.cpp
@@ -272,17 +272,17 @@ NS_IMPL_RELEASE_INHERITED(XULTreeGridRow
                           XULTreeItemAccessibleBase)
 
 ////////////////////////////////////////////////////////////////////////////////
 // XULTreeGridRowAccessible: Accessible implementation
 
 void
 XULTreeGridRowAccessible::Shutdown()
 {
-  if (!mDoc->IsDefunct()) {
+  if (mDoc && !mDoc->IsDefunct()) {
     UnbindCacheEntriesFromDocument(mAccessibleCache);
   }
 
   XULTreeItemAccessibleBase::Shutdown();
 }
 
 role
 XULTreeGridRowAccessible::NativeRole()
deleted file mode 100644
--- a/addon-sdk/Makefile.in
+++ /dev/null
@@ -1,29 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-TESTADDONS = source/test/addons
-ADDONSRC = $(srcdir)/$(TESTADDONS)
-
-include $(topsrcdir)/config/rules.mk
-
-# This can switch to just zipping the files when native jetpacks land
-%.xpi: FORCE
-	$(PYTHON) $(srcdir)/source/bin/cfx xpi --no-strip-xpi --pkgdir=$(ADDONSRC)/$* --output-file=$@
-
-TEST_FILES = \
-  $(srcdir)/source/app-extension \
-  $(srcdir)/source/bin \
-  $(srcdir)/source/python-lib \
-  $(srcdir)/source/test \
-  $(srcdir)/source/package.json \
-  $(srcdir)/source/mapping.json \
-  $(NULL)
-
-# Remove this once the test harness uses the APIs built into Firefox
-TEST_FILES += $(srcdir)/source/lib
-
-PKG_STAGE = $(DIST)/test-stage
-
-stage-tests-package:: $(TEST_FILES)
-	$(INSTALL) $^ $(PKG_STAGE)/jetpack
deleted file mode 100644
--- a/addon-sdk/moz.build
+++ /dev/null
@@ -1,122 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-# Makefile.in uses a misc target through test_addons_TARGET.
-HAS_MISC_RULE = True
-
-BROWSER_CHROME_MANIFESTS += ['test/browser.ini']
-JETPACK_PACKAGE_MANIFESTS += ['source/test/jetpack-package.ini']
-
-DIRS += ['source/test/fixtures']
-
-EXTRA_JS_MODULES.sdk += [
-    'source/app-extension/bootstrap.js',
-]
-
-EXTRA_JS_MODULES.sdk.system += [
-    'source/modules/system/Startup.js',
-]
-
-modules = [
-    'index.js',
-    'jetpack-id/index.js',
-    'method/core.js',
-    'mozilla-toolkit-versioning/index.js',
-    'mozilla-toolkit-versioning/lib/utils.js',
-    'node/os.js',
-    'sdk/addon/installer.js',
-    'sdk/addon/window.js',
-    'sdk/base64.js',
-    'sdk/clipboard.js',
-    'sdk/console/plain-text.js',
-    'sdk/console/traceback.js',
-    'sdk/core/disposable.js',
-    'sdk/core/heritage.js',
-    'sdk/core/namespace.js',
-    'sdk/core/observer.js',
-    'sdk/core/promise.js',
-    'sdk/core/reference.js',
-    'sdk/deprecated/unit-test-finder.js',
-    'sdk/deprecated/unit-test.js',
-    'sdk/deprecated/window-utils.js',
-    'sdk/event/chrome.js',
-    'sdk/event/core.js',
-    'sdk/event/dom.js',
-    'sdk/event/target.js',
-    'sdk/event/utils.js',
-    'sdk/frame/utils.js',
-    'sdk/io/file.js',
-    'sdk/lang/functional.js',
-    'sdk/lang/functional/concurrent.js',
-    'sdk/lang/functional/core.js',
-    'sdk/lang/functional/helpers.js',
-    'sdk/lang/type.js',
-    'sdk/lang/weak-set.js',
-    'sdk/net/url.js',
-    'sdk/platform/xpcom.js',
-    'sdk/preferences/service.js',
-    'sdk/preferences/utils.js',
-    'sdk/private-browsing.js',
-    'sdk/private-browsing/utils.js',
-    'sdk/querystring.js',
-    'sdk/self.js',
-    'sdk/system.js',
-    'sdk/system/environment.js',
-    'sdk/system/events.js',
-    'sdk/system/globals.js',
-    'sdk/system/process.js',
-    'sdk/system/runtime.js',
-    'sdk/system/unload.js',
-    'sdk/system/xul-app.js',
-    'sdk/system/xul-app.jsm',
-    'sdk/test.js',
-    'sdk/test/assert.js',
-    'sdk/test/harness.js',
-    'sdk/test/loader.js',
-    'sdk/test/options.js',
-    'sdk/test/utils.js',
-    'sdk/timers.js',
-    'sdk/uri/resource.js',
-    'sdk/url.js',
-    'sdk/url/utils.js',
-    'sdk/util/array.js',
-    'sdk/util/collection.js',
-    'sdk/util/deprecate.js',
-    'sdk/util/dispatcher.js',
-    'sdk/util/list.js',
-    'sdk/util/object.js',
-    'sdk/util/sequence.js',
-    'sdk/util/uuid.js',
-    'sdk/window/utils.js',
-    'sdk/zip/utils.js',
-    'test.js',
-    'toolkit/loader.js',
-    'toolkit/require.js',
-]
-
-commonjs = EXTRA_JS_MODULES.commonjs
-
-sources = {}
-def get_sources(path):
-    key = '/'.join(path)
-    if key in sources:
-        return sources[key]
-
-    source_dir = commonjs
-    for dir_ in path:
-        source_dir = source_dir[dir_]
-
-    sources[key] = source_dir
-    return source_dir
-
-for module in modules:
-    path = module.split('/')[:-1]
-
-    source_dir = get_sources(path)
-    source_dir += ['source/lib/%s' % module]
-
-with Files("**"):
-    BUG_COMPONENT = ("Add-on SDK", "General")
deleted file mode 100644
--- a/addon-sdk/source/.gitattributes
+++ /dev/null
@@ -1,5 +0,0 @@
-.gitignore export-ignore
-.hgignore export-ignore
-.hgtags export-ignore
-.gitattributes export-ignore
-python-lib/cuddlefish/_version.py export-subst
deleted file mode 100644
--- a/addon-sdk/source/.gitignore
+++ /dev/null
@@ -1,36 +0,0 @@
-local.json
-python-lib/cuddlefish/app-extension/components/jetpack.xpt
-testdocs.tgz
-jetpack-sdk-docs.tgz
-.test_tmp/
-doc/dev-guide/
-doc/index.html
-doc/modules/
-doc/status.md5
-packages/*
-node_modules
-cache
-
-# Python
-*.pyc
-
-# OSX
-*.DS_Store
-
-# Windows
-*Thumbs.db
-
-# Ignore subtrees
-
-# git@github.com:jsantell/jetpack-id.git
-lib/jetpack-id/*
-!lib/jetpack-id/index.js
-!lib/jetpack-id/package.json
-
-# git@github.com:jsantell/mozilla-toolkit-versioning.git
-lib/mozilla-toolkit-versioning/*
-!lib/mozilla-toolkit-versioning/index.js
-!lib/mozilla-toolkit-versioning/lib
-lib/mozilla-toolkit-versioning/lib/*
-!lib/mozilla-toolkit-versioning/lib/*.js
-!lib/mozilla-toolkit-versioning/package.json
deleted file mode 100644
--- a/addon-sdk/source/.hgignore
+++ /dev/null
@@ -1,15 +0,0 @@
-syntax: glob
-local.json
-python-lib/cuddlefish/app-extension/components/jetpack.xpt
-testdocs.tgz
-jetpack-sdk-docs.tgz
-.test_tmp
-jetpack-sdk-docs
-node_modules
-
-# These should really be in a global .hgignore, but such a thing
-# seems ridiculously confusing to set up, so we'll include some
-# common intermediate files here.
-*.pyc
-*~
-*.DS_Store
deleted file mode 100644
--- a/addon-sdk/source/.hgtags
+++ /dev/null
@@ -1,64 +0,0 @@
-39c45211aa250d43f6e54b776a60ef07a7a4cbb6 jep-31-examples
-0120642297b217680e75e68c4005a93b16466001 0.1rc1
-1fd7993ff2cec39c5948a1b2535b78c2d4c65858 0.1rc2
-530e51d02922ad05fd43e8cf113618068216b0cf 0.1
-ed11a9e3ae23aefd56ac88042b9816887d10a04f 0.2rc1
-f70ab8998abdce809bda93408435f83648909cdd 0.2rc2
-f70ab8998abdce809bda93408435f83648909cdd 0.2
-436968c6ec833d9c18a15426be26595a44b79283 0.3rc1
-a3b091d29607f0bcecf77fe27801ba901142f1c9 0.3
-06031b56312ad7f1880a9620b4d26ce253a23b23 0.3rc2
-a3b091d29607f0bcecf77fe27801ba901142f1c9 0.3
-4b08c8a8c1eef71ac3aa54e004b68e87049ca56b 0.3
-6884e54fd6a1cfa9ec63910c46d2cbf51495b584 0.3rc3
-4b08c8a8c1eef71ac3aa54e004b68e87049ca56b 0.3
-cd70b7140ec20689255f1248512a1e5b9cf90a32 0.3
-d9d733666ca8738e9665ba816d5d12f41fc0d216 0.4rc1
-8d2871fc10df16740273f53ef05815310da4b210 0.4
-201e60065b1aef23259a71756f93207cffa2abd5 0.4rc2
-8d2871fc10df16740273f53ef05815310da4b210 0.4
-c0e5bbdcafad4572a5de22e533543bf3330a869e 0.4
-201e60065b1aef23259a71756f93207cffa2abd5 0.4rc2
-a8dceaefd6f3376b7bc1619cccd854591b76ecc0 0.4rc2
-c0e5bbdcafad4572a5de22e533543bf3330a869e 0.4
-dfa3bdfedb12d743b5e0ac19d0ecf116b567a0b3 0.4
-b519a0848585e2a665a14aac2fb6f15c0a839e6c 0.4rc3
-dfa3bdfedb12d743b5e0ac19d0ecf116b567a0b3 0.4
-05acdf4987c28d8cc1d5a12d87e71b1445fdd6b7 0.4
-04b5afe48d1cee819d9f0af72ed16556a075b67d 0.5rc1
-1968150561097bcfeeb28a75801ef881d2fcbbf5 0.5
-3236e68e6f2e36353e47f01a9b8acfce56686263 0.5rc2
-1968150561097bcfeeb28a75801ef881d2fcbbf5 0.5
-0097da78aa23be8b7a5a811c4be0e3e35395af43 0.5
-be7016807a69c910ac31ff068a6c2bde0a25c9d4 0.5rc3
-0097da78aa23be8b7a5a811c4be0e3e35395af43 0.5
-83e97107e4a381b898c780b32e30e48b0e4d37f3 0.5
-182a405aa393dbd412e671e8516d2decd8e8d80c 0.6rc1
-96799a3d96abfdb1408f9b8e30479668f1feed70 0.6
-c5f6cdfa36b2ad33d8017e6844992de0b0a6c0e0 0.6rc2
-96799a3d96abfdb1408f9b8e30479668f1feed70 0.6
-65c393fbc6af7db79a4a2e903d06b17e90d254bf 0.6
-3e747e3e307a4e853d468b03357f96b2172bad37 0.7rc1
-b0e97e12eb9115f08127cc447d459f871c5046ed 0.7
-37288479d249168668abd60a907620fa7f593128 0.7rc2
-b0e97e12eb9115f08127cc447d459f871c5046ed 0.7
-db0eabc310619d00ce47372ecaafba7d2539b601 0.7
-37288479d249168668abd60a907620fa7f593128 0.7rc2
-b90bedb83525d8f32ebb4d3833e8d91efa991b6d 0.7rc2
-db0eabc310619d00ce47372ecaafba7d2539b601 0.7
-e6ea2e5c5274cbbb0278dc976844dbf51818a95e 0.7
-b90bedb83525d8f32ebb4d3833e8d91efa991b6d 0.7rc2
-9b978d823509de5d52ca222b9907f72591c68c5a 0.7rc2
-e6ea2e5c5274cbbb0278dc976844dbf51818a95e 0.7
-cd71e1e77c93adf169b9f38184b1f95d423876ba 0.7
-67e3fd285fa955898a2641226c86725365d68b95 0.8rc1
-b2f9405db6d74c21601ca9c250887411c837396a 0.8
-67e3fd285fa955898a2641226c86725365d68b95 0.8rc1
-56e8179ff5b467959ddf33978558d7eb5346ee53 0.8rc1
-b2f9405db6d74c21601ca9c250887411c837396a 0.8
-51a22a186b1c7d8e7292a5ec9670752dad223ca1 0.8
-d150cca77cfef60dee2f2fe7c892fd7fc5ce83c4 0.9rc1
-1e106beb57f65fabc32682f277de51a8101c919b 0.9
-173d56fa8cc1c5622eae70f1ae88ef789de4722b 0.9rc2
-1e106beb57f65fabc32682f277de51a8101c919b 0.9
-cde12eefd178d7a0ee7d5e9ae77f3089bcbdc6ec 0.9
deleted file mode 100644
--- a/addon-sdk/source/.jpmignore
+++ /dev/null
@@ -1,18 +0,0 @@
-local.json
-mapping.json
-CONTRIBUTING.md
-@addon-sdk.xpi
-.*
-app-extension/
-bin/
-modules/
-node_modules/
-examples/
-cache/
-
-# Python
-python-lib/
-*.pyc
-
-# Windows
-*Thumbs.db
deleted file mode 100644
--- a/addon-sdk/source/.travis.yml
+++ /dev/null
@@ -1,26 +0,0 @@
-sudo: false
-language: node_js
-node_js:
-  - "0.12"
-
-env:
-  - JPM_FX_DEBUG=0
-  - JPM_FX_DEBUG=1
-
-notifications:
-  irc: "irc.mozilla.org#jetpack"
-
-cache:
-  directories:
-  - cache
-
-before_install:
-  - "export DISPLAY=:99.0"
-  - "/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1280x1024x16 -extension RANDR"
-
-before_script:
-  - npm install fx-download -g
-  - npm install gulp -g
-  - bash bin/fx-download.sh
-  - export JPM_FIREFOX_BINARY=$TRAVIS_BUILD_DIR/../firefox/firefox
-  - cd $TRAVIS_BUILD_DIR
deleted file mode 100644
--- a/addon-sdk/source/CONTRIBUTING.md
+++ /dev/null
@@ -1,54 +0,0 @@
-##  Overview
-
-- Changes should follow the [design guidelines], as well as the [coding style guide]
-- All changes need tests
-- In order to land, changes need a review by one of the Jetpack reviewers
-- Changes may need an API review
-- Changes may need a review from a Mozilla platform domain-expert
-
-If you have questions, ask in [#jetpack on IRC][jetpack irc channel] or on the [Jetpack mailing list].
-
-## How to Make Code Contributions
-
-Follow the [standard mozilla contribution guidelines](https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Introduction). All contributions and patches should be through Bugzilla.
-
-Pull requests on github are not accepted and new pull requests on github will be rejected.
-
-## Good First Bugs
-
-There is a list of [good first bugs here][good first bugs].
-
-## Reviewers
-
-Changes should be reviewed by someone on the [add-on sdk review team](https://bugzilla.mozilla.org/page.cgi?id=review_suggestions.html#Add-on%20SDK) within Bugzilla.
-
-Others who might be able to help include:
-
-- [@mossop]
-- [@gozala]
-- [@ZER0]
-- [@jsantell]
-- [@zombie]
-
-For review of Mozilla platform usage and best practices, ask [@autonome],
-[@0c0w3], or [@mossop] to find the domain expert.
-
-For API and developer ergonomics review, ask [@gozala].
-
-[design guidelines]:https://wiki.mozilla.org/Labs/Jetpack/Design_Guidelines
-[jetpack irc channel]:irc://irc.mozilla.org/#jetpack
-[Jetpack mailing list]:http://groups.google.com/group/mozilla-labs-jetpack
-[open bugs]:https://bugzilla.mozilla.org/buglist.cgi?quicksearch=product%3ASDK
-[make bug]:https://bugzilla.mozilla.org/enter_bug.cgi?product=Add-on%20SDK&component=general
-[test intro]:https://developer.mozilla.org/en-US/Add-ons/SDK/Tutorials/Unit_testing
-[test API]:https://developer.mozilla.org/en-US/Add-ons/SDK/Low-Level_APIs/test_assert
-[coding style guide]:https://github.com/mozilla/addon-sdk/wiki/Coding-style-guide
-[Add-on SDK repo]:https://github.com/mozilla/addon-sdk
-[GitHub]:https://github.com/
-[good first bugs]:https://bugzilla.mozilla.org/buglist.cgi?list_id=7345714&columnlist=bug_severity%2Cpriority%2Cassigned_to%2Cbug_status%2Ctarget_milestone%2Cresolution%2Cshort_desc%2Cchangeddate&query_based_on=jetpack-good-1st-bugs&status_whiteboard_type=allwordssubstr&query_format=advanced&status_whiteboard=[good%20first%20bug]&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&bug_status=VERIFIED&product=Add-on%20SDK&known_name=jetpack-good-1st-bugs
-
-[@mossop]:https://github.com/mossop/
-[@gozala]:https://github.com/Gozala/
-[@ZER0]:https://github.com/ZER0/
-[@jsantell]:https://github.com/jsantell
-[@zombie]:https://github.com/zombie
deleted file mode 100644
--- a/addon-sdk/source/LICENSE
+++ /dev/null
@@ -1,30 +0,0 @@
-The files which make up the SDK are developed by Mozilla and licensed
-under the MPL 2.0 (http://mozilla.org/MPL/2.0/), with the exception of the
-components listed below, which are made available by their authors under
-the licenses listed alongside.
-
-syntaxhighlighter
-------------------
-doc/static-files/syntaxhighlighter
-Made available under the MIT license.
-
-jQuery
-------
-examples/reddit-panel/data/jquery-1.4.4.min.js
-examples/annotator/data/jquery-1.4.2.min.js
-Made available under the MIT license.
-
-simplejson
-----------
-python-lib/simplejson
-Made available under the MIT license.
-
-Python Markdown
----------------
-python-lib/markdown
-Made available under the BSD license.
-
-LibraryDetector
----------------
-examples/library-detector/data/library-detector.js
-Made available under the MIT license.
deleted file mode 100644
--- a/addon-sdk/source/README.md
+++ /dev/null
@@ -1,34 +0,0 @@
-# Mozilla Add-on SDK [![Build Status](https://travis-ci.org/mozilla/addon-sdk.png)](https://travis-ci.org/mozilla/addon-sdk)
-
-We suggest that developers of new add-ons [should look at using WebExtensions](https://developer.mozilla.org/en-US/Add-ons/WebExtensions).
-
-Using the Add-on SDK you can create Firefox add-ons using standard Web technologies: JavaScript, HTML, and CSS. The SDK includes JavaScript APIs which you can use to create add-ons, and tools for creating, running, testing, and packaging add-ons.
-
-If you find a problem, please [report the bug here](https://bugzilla.mozilla.org/enter_bug.cgi?product=Add-on%20SDK).
-
-## Developing Add-ons
-
-These resources offer some help:
-
-* [Add-on SDK Documentation](https://developer.mozilla.org/en-US/Add-ons/SDK)
-* [Community Developed Modules](https://github.com/mozilla/addon-sdk/wiki/Community-developed-modules)
-* [Jetpack FAQ](https://wiki.mozilla.org/Jetpack/FAQ)
-* [StackOverflow Questions](http://stackoverflow.com/questions/tagged/firefox-addon-sdk)
-* [Mailing List](https://wiki.mozilla.org/Jetpack#Mailing_list)
-* #jetpack on irc.mozilla.org
-
-## Contributing Code
-
-Please read these two guides if you wish to make some patches to the addon-sdk:
-
-* [Contribute Guide](https://github.com/mozilla/addon-sdk/blob/master/CONTRIBUTING.md)
-* [Style Guide](https://github.com/mozilla/addon-sdk/wiki/Coding-style-guide)
-
-## Issues
-
-We use [bugzilla](https://bugzilla.mozilla.org/) as our issue tracker, here are some useful links:
-
-* [File a bug](https://bugzilla.mozilla.org/enter_bug.cgi?product=Add-on%20SDK)
-* [Open bugs](https://bugzilla.mozilla.org/buglist.cgi?bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&columnlist=bug_severity%2Cpriority%2Cassigned_to%2Cbug_status%2Ctarget_milestone%2Cresolution%2Cshort_desc%2Cchangeddate&product=Add-on%20SDK&query_format=advanced&order=priority)
-* [Good first bugs](https://bugzilla.mozilla.org/buglist.cgi?status_whiteboard=[good+first+bug]&&resolution=---&product=Add-on+SDK)
-* [Good next bugs](https://bugzilla.mozilla.org/buglist.cgi?status_whiteboard=[good+next+bug]&&resolution=---&product=Add-on+SDK)
deleted file mode 100644
--- a/addon-sdk/source/app-extension/application.ini
+++ /dev/null
@@ -1,11 +0,0 @@
-[App]
-Vendor=Varma
-Name=Test App
-Version=1.0
-BuildID=20060101
-Copyright=Copyright (c) 2009 Atul Varma
-ID=xulapp@toolness.com
-
-[Gecko]
-MinVersion=1.9.2.0
-MaxVersion=2.0.*
deleted file mode 100644
--- a/addon-sdk/source/app-extension/bootstrap.js
+++ /dev/null
@@ -1,362 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-// @see http://dxr.mozilla.org/mozilla-central/source/js/src/xpconnect/loader/mozJSComponentLoader.cpp
-
-'use strict';
-
-// IMPORTANT: Avoid adding any initialization tasks here, if you need to do
-// something before add-on is loaded consider addon/runner module instead!
-
-const { classes: Cc, Constructor: CC, interfaces: Ci, utils: Cu,
-        results: Cr, manager: Cm } = Components;
-const ioService = Cc['@mozilla.org/network/io-service;1'].
-                  getService(Ci.nsIIOService);
-const resourceHandler = ioService.getProtocolHandler('resource').
-                        QueryInterface(Ci.nsIResProtocolHandler);
-const systemPrincipal = CC('@mozilla.org/systemprincipal;1', 'nsIPrincipal')();
-const scriptLoader = Cc['@mozilla.org/moz/jssubscript-loader;1'].
-                     getService(Ci.mozIJSSubScriptLoader);
-const prefService = Cc['@mozilla.org/preferences-service;1'].
-                    getService(Ci.nsIPrefService).
-                    QueryInterface(Ci.nsIPrefBranch);
-const appInfo = Cc["@mozilla.org/xre/app-info;1"].
-                getService(Ci.nsIXULAppInfo);
-const vc = Cc["@mozilla.org/xpcom/version-comparator;1"].
-           getService(Ci.nsIVersionComparator);
-
-const { NetUtil } = Cu.import("resource://gre/modules/NetUtil.jsm", {});
-
-const Startup = Cu.import("resource://gre/modules/sdk/system/Startup.js", {}).exports;
-
-
-const REASON = [ 'unknown', 'startup', 'shutdown', 'enable', 'disable',
-                 'install', 'uninstall', 'upgrade', 'downgrade' ];
-
-const bind = Function.call.bind(Function.bind);
-
-var loader = null;
-var unload = null;
-var cuddlefishSandbox = null;
-var nukeTimer = null;
-
-var resourceDomains = [];
-function setResourceSubstitution(domain, uri) {
-  resourceDomains.push(domain);
-  resourceHandler.setSubstitution(domain, uri);
-}
-
-// Utility function that synchronously reads local resource from the given
-// `uri` and returns content string.
-function readURI(uri) {
-  let channel = NetUtil.newChannel({
-    uri: NetUtil.newURI(uri, 'UTF-8'),
-    loadUsingSystemPrincipal: true
-  });
-
-  let stream = channel.open2();
-
-  let cstream = Cc['@mozilla.org/intl/converter-input-stream;1'].
-    createInstance(Ci.nsIConverterInputStream);
-  cstream.init(stream, 'UTF-8', 0, 0);
-
-  let str = {};
-  let data = '';
-  let read = 0;
-  do {
-    read = cstream.readString(0xffffffff, str);
-    data += str.value;
-  } while (read != 0);
-
-  cstream.close();
-
-  return data;
-}
-
-// We don't do anything on install & uninstall yet, but in a future
-// we should allow add-ons to cleanup after uninstall.
-function install(data, reason) {}
-function uninstall(data, reason) {}
-
-function startup(data, reasonCode) {
-  try {
-    let reason = REASON[reasonCode];
-    // URI for the root of the XPI file.
-    // 'jar:' URI if the addon is packed, 'file:' URI otherwise.
-    // (Used by l10n module in order to fetch `locale` folder)
-    let rootURI = data.resourceURI.spec;
-
-    // TODO: Maybe we should perform read harness-options.json asynchronously,
-    // since we can't do anything until 'sessionstore-windows-restored' anyway.
-    let options = JSON.parse(readURI(rootURI + './harness-options.json'));
-
-    let id = options.jetpackID;
-    let name = options.name;
-
-    // Clean the metadata
-    options.metadata[name]['permissions'] = options.metadata[name]['permissions'] || {};
-
-    // freeze the permissionss
-    Object.freeze(options.metadata[name]['permissions']);
-    // freeze the metadata
-    Object.freeze(options.metadata[name]);
-
-    // Register a new resource 'domain' for this addon which is mapping to
-    // XPI's `resources` folder.
-    // Generate the domain name by using jetpack ID, which is the extension ID
-    // by stripping common characters that doesn't work as a domain name:
-    let uuidRe =
-      /^\{([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\}$/;
-
-    let domain = id.
-      toLowerCase().
-      replace(/@/g, '-at-').
-      replace(/\./g, '-dot-').
-      replace(uuidRe, '$1');
-
-    let prefixURI = 'resource://' + domain + '/';
-    let resourcesURI = ioService.newURI(rootURI + '/resources/');
-    setResourceSubstitution(domain, resourcesURI);
-
-    // Create path to URLs mapping supported by loader.
-    let paths = {
-      // Relative modules resolve to add-on package lib
-      './': prefixURI + name + '/lib/',
-      './tests/': prefixURI + name + '/tests/',
-      '': 'resource://gre/modules/commonjs/'
-    };
-
-    // Maps addon lib and tests ressource folders for each package
-    paths = Object.keys(options.metadata).reduce(function(result, name) {
-      result[name + '/'] = prefixURI + name + '/lib/'
-      result[name + '/tests/'] = prefixURI + name + '/tests/'
-      return result;
-    }, paths);
-
-    // We need to map tests folder when we run sdk tests whose package name
-    // is stripped
-    if (name == 'addon-sdk')
-      paths['tests/'] = prefixURI + name + '/tests/';
-
-    let useBundledSDK = options['force-use-bundled-sdk'];
-    if (!useBundledSDK) {
-      try {
-        useBundledSDK = prefService.getBoolPref("extensions.addon-sdk.useBundledSDK");
-      }
-      catch (e) {
-        // Pref doesn't exist, allow using Firefox shipped SDK
-      }
-    }
-
-    // Starting with Firefox 21.0a1, we start using modules shipped into firefox
-    // Still allow using modules from the xpi if the manifest tell us to do so.
-    // And only try to look for sdk modules in xpi if the xpi actually ship them
-    if (options['is-sdk-bundled'] &&
-        (vc.compare(appInfo.version, '21.0a1') < 0 || useBundledSDK)) {
-      // Maps sdk module folders to their resource folder
-      paths[''] = prefixURI + 'addon-sdk/lib/';
-      // test.js is usually found in root commonjs or SDK_ROOT/lib/ folder,
-      // so that it isn't shipped in the xpi. Keep a copy of it in sdk/ folder
-      // until we no longer support SDK modules in XPI:
-      paths['test'] = prefixURI + 'addon-sdk/lib/sdk/test.js';
-    }
-
-    // Retrieve list of module folder overloads based on preferences in order to
-    // eventually used a local modules instead of files shipped into Firefox.
-    let branch = prefService.getBranch('extensions.modules.' + id + '.path');
-    paths = branch.getChildList('', {}).reduce(function (result, name) {
-      // Allows overloading of any sub folder by replacing . by / in pref name
-      let path = name.substr(1).split('.').join('/');
-      // Only accept overloading folder by ensuring always ending with `/`
-      if (path) path += '/';
-      let fileURI = branch.getCharPref(name);
-
-      // On mobile, file URI has to end with a `/` otherwise, setSubstitution
-      // takes the parent folder instead.
-      if (fileURI[fileURI.length-1] !== '/')
-        fileURI += '/';
-
-      // Maps the given file:// URI to a resource:// in order to avoid various
-      // failure that happens with file:// URI and be close to production env
-      let resourcesURI = ioService.newURI(fileURI);
-      let resName = 'extensions.modules.' + domain + '.commonjs.path' + name;
-      setResourceSubstitution(resName, resourcesURI);
-
-      result[path] = 'resource://' + resName + '/';
-      return result;
-    }, paths);
-
-    // Make version 2 of the manifest
-    let manifest = options.manifest;
-
-    // Import `cuddlefish.js` module using a Sandbox and bootstrap loader.
-    let cuddlefishPath = 'loader/cuddlefish.js';
-    let cuddlefishURI = 'resource://gre/modules/commonjs/sdk/' + cuddlefishPath;
-    if (paths['sdk/']) { // sdk folder has been overloaded
-                         // (from pref, or cuddlefish is still in the xpi)
-      cuddlefishURI = paths['sdk/'] + cuddlefishPath;
-    }
-    else if (paths['']) { // root modules folder has been overloaded
-      cuddlefishURI = paths[''] + 'sdk/' + cuddlefishPath;
-    }
-
-    cuddlefishSandbox = loadSandbox(cuddlefishURI);
-    let cuddlefish = cuddlefishSandbox.exports;
-
-    // Normalize `options.mainPath` so that it looks like one that will come
-    // in a new version of linker.
-    let main = options.mainPath;
-
-    unload = cuddlefish.unload;
-    loader = cuddlefish.Loader({
-      paths: paths,
-      // modules manifest.
-      manifest: manifest,
-
-      // Add-on ID used by different APIs as a unique identifier.
-      id: id,
-      // Add-on name.
-      name: name,
-      // Add-on version.
-      version: options.metadata[name].version,
-      // Add-on package descriptor.
-      metadata: options.metadata[name],
-      // Add-on load reason.
-      loadReason: reason,
-
-      prefixURI: prefixURI,
-      // Add-on URI.
-      rootURI: rootURI,
-      // options used by system module.
-      // File to write 'OK' or 'FAIL' (exit code emulation).
-      resultFile: options.resultFile,
-      // Arguments passed as --static-args
-      staticArgs: options.staticArgs,
-
-      // Option to prevent automatic kill of firefox during tests
-      noQuit: options.no_quit,
-
-      // Add-on preferences branch name
-      preferencesBranch: options.preferencesBranch,
-
-      // Arguments related to test runner.
-      modules: {
-        '@test/options': {
-          iterations: options.iterations,
-          filter: options.filter,
-          profileMemory: options.profileMemory,
-          stopOnError: options.stopOnError,
-          verbose: options.verbose,
-          parseable: options.parseable,
-          checkMemory: options.check_memory,
-        }
-      }
-    });
-
-    let module = cuddlefish.Module('sdk/loader/cuddlefish', cuddlefishURI);
-    let require = cuddlefish.Require(loader, module);
-
-    // Init the 'sdk/webextension' module from the bootstrap addon parameter.
-    require("sdk/webextension").initFromBootstrapAddonParam(data);
-
-    require('sdk/addon/runner').startup(reason, {
-      loader: loader,
-      main: main,
-      prefsURI: rootURI + 'defaults/preferences/prefs.js'
-    });
-  } catch (error) {
-    dump('Bootstrap error: ' +
-         (error.message ? error.message : String(error)) + '\n' +
-         (error.stack || error.fileName + ': ' + error.lineNumber) + '\n');
-    throw error;
-  }
-};
-
-function loadSandbox(uri) {
-  let proto = {
-    sandboxPrototype: {
-      loadSandbox: loadSandbox,
-      ChromeWorker: ChromeWorker
-    }
-  };
-  let sandbox = Cu.Sandbox(systemPrincipal, proto);
-  // Create a fake commonjs environnement just to enable loading loader.js
-  // correctly
-  sandbox.exports = {};
-  sandbox.module = { uri: uri, exports: sandbox.exports };
-  sandbox.require = function (id) {
-    if (id !== "chrome")
-      throw new Error("Bootstrap sandbox `require` method isn't implemented.");
-
-    return Object.freeze({ Cc: Cc, Ci: Ci, Cu: Cu, Cr: Cr, Cm: Cm,
-      CC: bind(CC, Components), components: Components,
-      ChromeWorker: ChromeWorker });
-  };
-  scriptLoader.loadSubScript(uri, sandbox, 'UTF-8');
-  return sandbox;
-}
-
-function unloadSandbox(sandbox) {
-  if (Cu.getClassName(sandbox, true) == "Sandbox")
-    Cu.nukeSandbox(sandbox);
-}
-
-function setTimeout(callback, delay) {
-  let timer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
-  timer.initWithCallback({ notify: callback }, delay,
-                         Ci.nsITimer.TYPE_ONE_SHOT);
-  return timer;
-}
-
-function shutdown(data, reasonCode) {
-  let reason = REASON[reasonCode];
-  if (loader) {
-    unload(loader, reason);
-    unload = null;
-
-    // Don't waste time cleaning up if the application is shutting down
-    if (reason != "shutdown") {
-      // Avoid leaking all modules when something goes wrong with one particular
-      // module. Do not clean it up immediatly in order to allow executing some
-      // actions on addon disabling.
-      // We need to keep a reference to the timer, otherwise it is collected
-      // and won't ever fire.
-      nukeTimer = setTimeout(nukeModules, 1000);
-
-      // Bug 944951 - bootstrap.js must remove the added resource: URIs on unload
-      resourceDomains.forEach(domain => {
-        resourceHandler.setSubstitution(domain, null);
-      })
-    }
-  }
-};
-
-function nukeModules() {
-  nukeTimer = null;
-  // module objects store `exports` which comes from sandboxes
-  // We should avoid keeping link to these object to avoid leaking sandboxes
-  for (let key in loader.modules) {
-    delete loader.modules[key];
-  }
-  // Direct links to sandboxes should be removed too
-  for (let key in loader.sandboxes) {
-    let sandbox = loader.sandboxes[key];
-    delete loader.sandboxes[key];
-    // Bug 775067: From FF17 we can kill all CCW from a given sandbox
-    unloadSandbox(sandbox);
-  }
-  unloadSandbox(loader.sharedGlobalSandbox);
-  loader = null;
-
-  // both `toolkit/loader` and `system/xul-app` are loaded as JSM's via
-  // `cuddlefish.js`, and needs to be unloaded to avoid memory leaks, when
-  // the addon is unload.
-
-  unloadSandbox(cuddlefishSandbox.loaderSandbox);
-
-  // Bug 764840: We need to unload cuddlefish otherwise it will stay alive
-  // and keep a reference to this compartment.
-  unloadSandbox(cuddlefishSandbox);
-  cuddlefishSandbox = null;
-}
deleted file mode 100644
--- a/addon-sdk/source/app-extension/install.rdf
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0"?>
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
-   - License, v. 2.0. If a copy of the MPL was not distributed with this
-   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-     xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-  <Description about="urn:mozilla:install-manifest">
-    <em:id>xulapp@toolness.com</em:id>
-    <em:version>1.0</em:version>
-    <em:type>2</em:type>
-    <em:bootstrap>true</em:bootstrap>
-    <em:unpack>false</em:unpack>
-
-    <!-- Firefox -->
-    <em:targetApplication>
-      <Description>
-        <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
-        <em:minVersion>26.0</em:minVersion>
-        <em:maxVersion>30.0</em:maxVersion>
-      </Description>
-    </em:targetApplication>
-
-    <!-- Front End MetaData -->
-    <em:name>Test App</em:name>
-    <em:description>Harness for tests.</em:description>
-    <em:creator>Mozilla Corporation</em:creator>
-    <em:homepageURL></em:homepageURL>
-    <em:optionsType></em:optionsType>
-    <em:optionsURL></em:optionsURL>
-    <em:updateURL></em:updateURL>
-  </Description>
-</RDF>
deleted file mode 100644
--- a/addon-sdk/source/bin/activate
+++ /dev/null
@@ -1,84 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-# This file must be used with "source bin/activate" *from bash*
-# you cannot run it directly
-
-deactivate () {
-    if [ -n "$_OLD_VIRTUAL_PATH" ] ; then
-        PATH="$_OLD_VIRTUAL_PATH"
-        export PATH
-        unset _OLD_VIRTUAL_PATH
-    fi
-
-    # This should detect bash and zsh, which have a hash command that must
-    # be called to get it to forget past commands.  Without forgetting
-    # past commands the $PATH changes we made may not be respected
-    if [ -n "$BASH" -o -n "$ZSH_VERSION" ] ; then
-        hash -r
-    fi
-
-    if [ -n "$_OLD_VIRTUAL_PS1" ] ; then
-        PS1="$_OLD_VIRTUAL_PS1"
-        export PS1
-        unset _OLD_VIRTUAL_PS1
-    fi
-
-    PYTHONPATH="$_OLD_PYTHONPATH"
-    export PYTHONPATH
-    unset _OLD_PYTHONPATH
-
-    unset CUDDLEFISH_ROOT
-
-    unset VIRTUAL_ENV
-    if [ ! "$1" = "nondestructive" ] ; then
-    # Self destruct!
-        unset deactivate
-    fi
-}
-
-# unset irrelavent variables
-deactivate nondestructive
-
-_OLD_PYTHONPATH="$PYTHONPATH"
-_OLD_VIRTUAL_PATH="$PATH"
-
-VIRTUAL_ENV="`pwd`"
-
-if [ "x$OSTYPE" = "xmsys" ] ; then
-  CUDDLEFISH_ROOT="`pwd -W | sed s,/,\\\\\\\\,g`"
-  PATH="`pwd`/bin:$PATH"
-  # msys will convert any env vars with PATH in it to use msys
-  # form and will unconvert before launching
-  PYTHONPATH="`pwd -W`/python-lib;$PYTHONPATH"
-else
-  CUDDLEFISH_ROOT="$VIRTUAL_ENV"
-  PYTHONPATH="$VIRTUAL_ENV/python-lib:$PYTHONPATH"
-  PATH="$VIRTUAL_ENV/bin:$PATH"
-fi
-
-VIRTUAL_ENV="`pwd`"
-
-export CUDDLEFISH_ROOT
-export PYTHONPATH
-export PATH
-
-_OLD_VIRTUAL_PS1="$PS1"
-if [ "`basename \"$VIRTUAL_ENV\"`" = "__" ] ; then
-    # special case for Aspen magic directories
-    # see http://www.zetadev.com/software/aspen/
-    PS1="[`basename \`dirname \"$VIRTUAL_ENV\"\``] $PS1"
-else
-    PS1="(`basename \"$VIRTUAL_ENV\"`)$PS1"
-fi
-export PS1
-
-# This should detect bash and zsh, which have a hash command that must
-# be called to get it to forget past commands.  Without forgetting
-# past commands the $PATH changes we made may not be respected
-if [ -n "$BASH" -o -n "$ZSH_VERSION" ] ; then
-    hash -r
-fi
-
-python -c "from jetpack_sdk_env import welcome; welcome()"
deleted file mode 100644
--- a/addon-sdk/source/bin/activate.bat
+++ /dev/null
@@ -1,134 +0,0 @@
-@echo off
-rem This Source Code Form is subject to the terms of the Mozilla Public
-rem License, v. 2.0. If a copy of the MPL was not distributed with this
-rem file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-set VIRTUAL_ENV=%~dp0
-set VIRTUAL_ENV=%VIRTUAL_ENV:~0,-5%
-set CUDDLEFISH_ROOT=%VIRTUAL_ENV%
-
-SET PYTHONKEY=SOFTWARE\Python\PythonCore
-
-rem look for 32-bit windows and python, or 64-bit windows and python
-
-SET PYTHONVERSION=2.7
-call:CheckPython PYTHONINSTALL %PYTHONKEY%\%PYTHONVERSION%\InstallPath
-if "%PYTHONINSTALL%" NEQ "" goto FoundPython
-
-SET PYTHONVERSION=2.6
-call:CheckPython PYTHONINSTALL %PYTHONKEY%\%PYTHONVERSION%\InstallPath
-if "%PYTHONINSTALL%" NEQ "" goto FoundPython
-
-SET PYTHONVERSION=2.5
-call:CheckPython PYTHONINSTALL %PYTHONKEY%\%PYTHONVERSION%\InstallPath
-if "%PYTHONINSTALL%" NEQ "" goto FoundPython
-
-if not defined ProgramFiles(x86) goto win32
-
-rem look for 32-bit python on 64-bit windows
-
-SET PYTHONKEY=SOFTWARE\Wow6432Node\Python\PythonCore
-
-SET PYTHONVERSION=2.7
-call:CheckPython PYTHONINSTALL %PYTHONKEY%\%PYTHONVERSION%\InstallPath
-if "%PYTHONINSTALL%" NEQ "" goto FoundPython
-
-SET PYTHONVERSION=2.6
-call:CheckPython PYTHONINSTALL %PYTHONKEY%\%PYTHONVERSION%\InstallPath
-if "%PYTHONINSTALL%" NEQ "" goto FoundPython
-
-SET PYTHONVERSION=2.5
-call:CheckPython PYTHONINSTALL %PYTHONKEY%\%PYTHONVERSION%\InstallPath
-if "%PYTHONINSTALL%" NEQ "" goto FoundPython
-
-:win32
-
-SET PYTHONVERSION=
-set PYTHONKEY=
-echo Warning: Failed to find Python installation directory
-goto :EOF
-
-:FoundPython
-
-if defined _OLD_PYTHONPATH (
-    set PYTHONPATH=%_OLD_PYTHONPATH%
-)
-if not defined PYTHONPATH (
-    set PYTHONPATH=;
-)
-set _OLD_PYTHONPATH=%PYTHONPATH%
-set PYTHONPATH=%VIRTUAL_ENV%\python-lib;%PYTHONPATH%
-
-if not defined PROMPT (
-    set PROMPT=$P$G
-)
-
-if defined _OLD_VIRTUAL_PROMPT (
-    set PROMPT=%_OLD_VIRTUAL_PROMPT%
-)
-
-set _OLD_VIRTUAL_PROMPT=%PROMPT%
-set PROMPT=(%VIRTUAL_ENV%) %PROMPT%
-
-if defined _OLD_VIRTUAL_PATH goto OLDPATH
-goto SKIPPATH
-:OLDPATH
-PATH %_OLD_VIRTUAL_PATH%
-
-:SKIPPATH
-set _OLD_VIRTUAL_PATH=%PATH%
-PATH %VIRTUAL_ENV%\bin;%PYTHONINSTALL%;%PATH%
-set PYTHONKEY=
-set PYTHONINSTALL=
-set PYTHONVERSION=
-set key=
-set reg=
-set _tokens=
-python -c "from jetpack_sdk_env import welcome; welcome()"
-GOTO :EOF
-
-:CheckPython
-::CheckPython(retVal, key)
-::Reads the registry at %2% and checks if a Python exists there.
-::Checks both HKLM and HKCU, then checks the executable actually exists.
-SET key=%2%
-SET "%~1="
-SET reg=reg
-if defined ProgramFiles(x86) (
-  rem 32-bit cmd on 64-bit windows
-  if exist %WINDIR%\sysnative\reg.exe SET reg=%WINDIR%\sysnative\reg.exe
-)
-rem On Vista+, the last line of output is:
-rem    (default)  REG_SZ  the_value
-rem (but note the word "default" will be localized.
-rem On XP, the last line of output is:
-rem   <NO NAME>\tREG_SZ\tthe_value
-rem (not sure if "NO NAME" is localized or not!)
-rem SO: we use ")>" as the tokens to split on, then nuke
-rem the REG_SZ and any tabs or spaces.
-FOR /F "usebackq tokens=2 delims=)>" %%A IN (`%reg% QUERY HKLM\%key% /ve 2^>NUL`) DO SET "%~1=%%A"
-rem Remove the REG_SZ
-set PYTHONINSTALL=%PYTHONINSTALL:REG_SZ=%
-rem Remove tabs (note the literal \t in the next line
-set PYTHONINSTALL=%PYTHONINSTALL:	=%
-rem Remove spaces.
-set PYTHONINSTALL=%PYTHONINSTALL: =%
-if exist %PYTHONINSTALL%\python.exe goto :EOF
-rem It may be a 32bit Python directory built from source, in which case the
-rem executable is in the PCBuild directory.
-if exist %PYTHONINSTALL%\PCBuild\python.exe (set "PYTHONINSTALL=%PYTHONINSTALL%\PCBuild" & goto :EOF)
-rem Or maybe a 64bit build directory.
-if exist %PYTHONINSTALL%\PCBuild\amd64\python.exe (set "PYTHONINSTALL=%PYTHONINSTALL%\PCBuild\amd64" & goto :EOF)
-
-rem And try HKCU
-FOR /F "usebackq tokens=2 delims=)>" %%A IN (`%reg% QUERY HKCU\%key% /ve 2^>NUL`) DO SET "%~1=%%A"
-set PYTHONINSTALL=%PYTHONINSTALL:REG_SZ=%
-set PYTHONINSTALL=%PYTHONINSTALL:	=%
-set PYTHONINSTALL=%PYTHONINSTALL: =%
-if exist %PYTHONINSTALL%\python.exe goto :EOF
-if exist %PYTHONINSTALL%\PCBuild\python.exe (set "PYTHONINSTALL=%PYTHONINSTALL%\PCBuild" & goto :EOF)
-if exist %PYTHONINSTALL%\PCBuild\amd64\python.exe (set "PYTHONINSTALL=%PYTHONINSTALL%\PCBuild\amd64" & goto :EOF)
-rem can't find it here, so arrange to try the next key
-set PYTHONINSTALL=
-
-GOTO :EOF
deleted file mode 100644
--- a/addon-sdk/source/bin/activate.fish
+++ /dev/null
@@ -1,66 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-# This file must be used with "source bin/activate.fish" *from fish*
-# you cannot run it directly
-
-# Much of this code is based off of the activate.fish file for the
-# virtualenv project. http://ur1.ca/ehmd6
-
-function deactivate -d "Exit addon-sdk and return to normal shell environment"
-    if test -n "$_OLD_VIRTUAL_PATH"
-        set -gx PATH $_OLD_VIRTUAL_PATH
-        set -e _OLD_VIRTUAL_PATH
-    end
-
-    if test -n "$_OLD_PYTHONPATH"
-        set -gx PYTHONPATH $_OLD_PYTHONPATH
-        set -e _OLD_PYTHONPATH
-    end
-
-    if test -n "$_OLD_FISH_PROMPT_OVERRIDE"
-        functions -e fish_prompt
-        set -e _OLD_FISH_PROMPT_OVERRIDE
-        . ( begin
-                printf "function fish_prompt\n\t#"
-                functions _old_fish_prompt
-            end | psub )
-
-        functions -e _old_fish_prompt
-    end
-
-    set -e CUDDLEFISH_ROOT
-    set -e VIRTUAL_ENV
-
-    if test "$argv[1]" != "nondestructive"
-        functions -e deactivate
-    end
-end
-
-# unset irrelavent variables
-deactivate nondestructive
-
-set -gx _OLD_PYTHONPATH $PYTHONPATH
-set -gx _OLD_VIRTUAL_PATH $PATH
-set -gx _OLD_FISH_PROMPT_OVERRIDE "true"
-
-set VIRTUAL_ENV (pwd)
-
-set -gx CUDDLEFISH_ROOT $VIRTUAL_ENV
-set -gx PYTHONPATH "$VIRTUAL_ENV/python-lib" $PYTHONPATH
-set -gx PATH "$VIRTUAL_ENV/bin" $PATH
-
-# save the current fish_prompt function as the function _old_fish_prompt
-. ( begin
-        printf "function _old_fish_prompt\n\t#"
-        functions fish_prompt
-    end | psub )
-
-# with the original prompt function renamed, we can override with our own.
-function fish_prompt
-    printf "(%s)%s%s" (basename "$VIRTUAL_ENV") (set_color normal) (_old_fish_prompt)
-    return
-end 
-
-python -c "from jetpack_sdk_env import welcome; welcome()"
deleted file mode 100644
--- a/addon-sdk/source/bin/activate.ps1
+++ /dev/null
@@ -1,99 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-$Env:VIRTUAL_ENV = (gl);
-$Env:CUDDLEFISH_ROOT = $Env:VIRTUAL_ENV;
-
-# http://stackoverflow.com/questions/5648931/powershell-test-if-registry-value-exists/5652674#5652674
-Function Test-RegistryValue {
-    param(
-        [Alias("PSPath")]
-        [Parameter(Position = 0, Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)]
-        [String]$Path
-        ,
-        [Parameter(Position = 1, Mandatory = $true)]
-        [String]$Name
-        ,
-        [Switch]$PassThru
-    ) 
-
-    process {
-        if (Test-Path $Path) {
-            $Key = Get-Item -LiteralPath $Path
-            if ($Key.GetValue($Name, $null) -ne $null) {
-                if ($PassThru) {
-                    Get-ItemProperty $Path $Name
-                } else {
-                    $true
-                }
-            } else {
-                $false
-            }
-        } else {
-            $false
-        }
-    }
-}
-
-$WINCURVERKEY = 'HKLM:SOFTWARE\Microsoft\Windows\CurrentVersion';
-$WIN64 = (Test-RegistryValue $WINCURVERKEY 'ProgramFilesDir (x86)');
-
-if($WIN64) { 
-    $PYTHONKEY='HKLM:SOFTWARE\Wow6432Node\Python\PythonCore';
-}
-else {
-    $PYTHONKEY='HKLM:SOFTWARE\Python\PythonCore';
-}
-
-$Env:PYTHONVERSION = '';
-$Env:PYTHONINSTALL = '';
-
-foreach ($version in @('2.6', '2.5', '2.4')) {
-    if (Test-RegistryValue "$PYTHONKEY\$version\InstallPath" '(default)') { 
-        $Env:PYTHONVERSION = $version;
-    }
-}
-
-if ($Env:PYTHONVERSION) { 
-    $Env:PYTHONINSTALL = (Get-Item "$PYTHONKEY\$version\InstallPath)").'(default)';
-}
-
-if ($Env:PYTHONINSTALL) { 
-    $Env:Path += ";$Env:PYTHONINSTALL";
-}
-
-if (Test-Path Env:_OLD_PYTHONPATH) { 
-    $Env:PYTHONPATH = $Env:_OLD_PYTHONPATH;
-}
-else {
-    $Env:PYTHONPATH = '';
-}
-
-$Env:_OLD_PYTHONPATH=$Env:PYTHONPATH;
-$Env:PYTHONPATH= "$Env:VIRTUAL_ENV\python-lib;$Env:PYTHONPATH";
-
-if (Test-Path Function:_OLD_VIRTUAL_PROMPT) {
-    Set-Content Function:Prompt (Get-Content Function:_OLD_VIRTUAL_PROMPT);
-}
-else {
-    function global:_OLD_VIRTUAL_PROMPT {}
-}
-
-Set-Content Function:_OLD_VIRTUAL_PROMPT (Get-Content Function:Prompt);
-
-function global:prompt { "($Env:VIRTUAL_ENV) $(_OLD_VIRTUAL_PROMPT)"; };
-
-if (Test-Path Env:_OLD_VIRTUAL_PATH) {
-    $Env:PATH = $Env:_OLD_VIRTUAL_PATH;
-}
-else {
-    $Env:_OLD_VIRTUAL_PATH = $Env:PATH;
-}
-
-$Env:Path="$Env:VIRTUAL_ENV\bin;$Env:Path"
-
-[System.Console]::WriteLine("Note: this PowerShell SDK activation script is experimental.")
-
-python -c "from jetpack_sdk_env import welcome; welcome()"
-
deleted file mode 100755
--- a/addon-sdk/source/bin/cfx
+++ /dev/null
@@ -1,33 +0,0 @@
-#! /usr/bin/env python
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-
-import os
-import sys
-
-# set the cuddlefish "root directory" for this process if it's not already
-# set in the environment
-cuddlefish_root = os.path.dirname(os.path.dirname(os.path.realpath(sys.argv[0])))
-
-if 'CUDDLEFISH_ROOT' not in os.environ:
-    os.environ['CUDDLEFISH_ROOT'] = cuddlefish_root
-
-# add our own python-lib path to the python module search path.
-python_lib_dir = os.path.join(cuddlefish_root, "python-lib")
-if python_lib_dir not in sys.path:
-    sys.path.insert(0, python_lib_dir)
-
-# now export to env so sub-processes get it too
-if 'PYTHONPATH' not in os.environ:
-    os.environ['PYTHONPATH'] = python_lib_dir
-elif python_lib_dir not in os.environ['PYTHONPATH'].split(os.pathsep):
-    paths = os.environ['PYTHONPATH'].split(os.pathsep)
-    paths.insert(0, python_lib_dir)
-    os.environ['PYTHONPATH'] = os.pathsep.join(paths)
-
-import cuddlefish
-
-if __name__ == '__main__':
-    cuddlefish.run()
deleted file mode 100644
--- a/addon-sdk/source/bin/cfx.bat
+++ /dev/null
@@ -1,6 +0,0 @@
-@echo off
-rem This Source Code Form is subject to the terms of the Mozilla Public
-rem License, v. 2.0. If a copy of the MPL was not distributed with this
-rem file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-python "%VIRTUAL_ENV%\bin\cfx" %*
deleted file mode 100644
--- a/addon-sdk/source/bin/deactivate.bat
+++ /dev/null
@@ -1,23 +0,0 @@
-@echo off
-rem This Source Code Form is subject to the terms of the Mozilla Public
-rem License, v. 2.0. If a copy of the MPL was not distributed with this
-rem file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-if defined _OLD_VIRTUAL_PROMPT (
-    set "PROMPT=%_OLD_VIRTUAL_PROMPT%"
-)
-set _OLD_VIRTUAL_PROMPT=
-
-if defined _OLD_VIRTUAL_PATH (
-    set "PATH=%_OLD_VIRTUAL_PATH%"
-)
-set _OLD_VIRTUAL_PATH=
-
-if defined _OLD_PYTHONPATH (
-    set "PYTHONPATH=%_OLD_PYTHONPATH%"
-)
-set _OLD_PYTHONPATH=
-
-set CUDDLEFISH_ROOT=
-
-:END
deleted file mode 100644
--- a/addon-sdk/source/bin/fx-download.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/sh
-
-if [ "$JPM_FX_DEBUG" = "1" ]; then
-  fx-download --branch nightly -c prerelease --host ftp.mozilla.org ../firefox --debug
-else
-  fx-download --branch nightly -c prerelease --host ftp.mozilla.org ../firefox
-fi
deleted file mode 100755
--- a/addon-sdk/source/bin/integration-scripts/buildbot-run-cfx-helper
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/bin/bash
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-
-source ./bin/activate
-if [ type -P xvfb-run ]
-then
-  xvfb-run cfx $*
-else
-  cfx $*
-fi  
-deactivate
deleted file mode 100644
--- a/addon-sdk/source/bin/integration-scripts/integration-check
+++ /dev/null
@@ -1,364 +0,0 @@
-#!/usr/bin/env python
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-import os
-import signal
-import threading
-import urllib2, urllib
-import zipfile
-import tarfile
-import subprocess
-import optparse
-import sys, re
-#import win32api
-
-
-class SDK:
-    def __init__(self):
-        try:
-            # Take the current working directory
-            self.default_path = os.getcwd()
-            if sys.platform == "win32":
-                self.mswindows = True
-            else:
-                self.mswindows = False
-            # Take the default home path of the user.
-            home = os.path.expanduser('~')
-
-            # The following are the parameters that can be used to pass a dynamic URL, a specific path or a binry. The binary is not used yet. It will be used in version 2.0
-            # If a dynamic path is to be mentioned, it should start with a '/'. For eg. "/Desktop"
-            parser = optparse.OptionParser()
-            parser.add_option('-u', '--url', dest = 'url', default = 'https://ftp.mozilla.org/pub/mozilla.org/labs/jetpack/addon-sdk-latest.zip')
-            parser.add_option('-p', '--path', dest = 'path', default = self.default_path)
-            parser.add_option('-b', '--binary', dest = 'binary')#, default='/Applications/Firefox.app')
-            (options, args) = parser.parse_args()
-      
-            # Get the URL from the parameter
-            self.link = options.url
-            # Set the base path for the user. If the user supplies the path, use the home variable as well. Else, take the default path of this script as the installation directory.
-            if options.path!=self.default_path:
-                if self.mswindows:
-                    self.base_path = home + str(options.path).strip() + '\\'
-                else:
-                    self.base_path = home + str(options.path).strip() + '/'
-            else:
-                if self.mswindows:
-                    self.base_path = str(options.path).strip() + '\\'
-                else:
-                    self.base_path = str(options.path).strip() + '/'
-            assert ' ' not in self.base_path, "You cannot have a space in your home path. Please remove the space before you continue."
-            print('Your Base path is =' + self.base_path)
-            
-            # This assignment is not used in this program. It will be used in version 2 of this script.
-            self.bin = options.binary
-            # if app or bin is empty, dont pass anything
-    
-            # Search for the .zip file or tarball file in the URL.
-            i = self.link.rfind('/')
-
-            self.fname = self.link[i+1:]
-            z = re.search('zip',self.fname,re.I)
-            g = re.search('gz',self.fname,re.I)
-            if z:
-                print 'zip file present in the URL.'
-                self.zip = True
-                self.gz = False
-            elif g:
-                print 'gz file present in the URL'
-                self.gz = True
-                self.zip = False
-            else:
-                print 'zip/gz file not present. Check the URL.'
-                return
-            print("File name is =" + self.fname)
-    
-            # Join the base path and the zip/tar file name to crate a complete Local file path.
-            self.fpath = self.base_path + self.fname
-            print('Your local file path will be=' + self.fpath)
-        except AssertionError, e:
-            print e.args[0] 
-            sys.exit(1)
-
-    # Download function - to download the SDK from the URL to the local machine.
-    def download(self,url,fpath,fname):
-        try:
-            # Start the download
-            print("Downloading...Please be patient!")
-            urllib.urlretrieve(url,filename = fname)
-            print('Download was successful.')
-        except ValueError: # Handles broken URL errors.
-            print 'The URL is ether broken or the file does not exist. Please enter the correct URL.'
-            raise
-        except urllib2.URLError: # Handles URL errors
-            print '\nURL not correct. Check again!'
-            raise
-
-    # Function to extract the downloaded zipfile.
-    def extract(self, zipfilepath, extfile):
-        try:
-            # Timeout is set to 30 seconds. 
-            timeout = 30
-            # Change the directory to the location of the zip file.
-            try:
-                os.chdir(zipfilepath)
-            except OSError:
-             # Will reach here if zip file doesnt exist
-                 print 'O/S Error:' + zipfilepath + 'does not exist'
-                 raise
-
-            # Get the folder name of Jetpack to get the exact version number.
-            if self.zip:
-                try:
-                    f = zipfile.ZipFile(extfile, "r")
-                except IOError as (errno, strerror): # Handles file errors
-                    print "I/O error - Cannot perform extract operation: {1}".format(errno, strerror)
-                    raise
-                list = f.namelist()[0]
-                temp_name = list.split('/')
-                print('Folder Name= ' +temp_name[0])
-                self.folder_name = temp_name[0]
-            elif self.gz:
-                try:
-                    f = tarfile.open(extfile,'r')
-                except IOError as (errno, strerror): # Handles file errors
-                    print "I/O error - Cannot perform extract operation: {1}".format(errno, strerror)
-                    raise
-                list = f.getnames()[0]
-                temp_name = list.split('/')
-                print('Folder Name= ' +temp_name[0])
-                self.folder_name = temp_name[0]
-
-            print ('Starting to Extract...')
-
-            # Timeout code. The subprocess.popen exeutes the command and the thread waits for a timeout. If the process does not finish within the mentioned-
-            # timeout, the process is killed.
-            kill_check = threading.Event()
-            
-            if self.zip:
-            # Call the command to unzip the file.
-                if self.mswindows:
-                    zipfile.ZipFile.extractall(f)
-                else:
-                    p = subprocess.Popen('unzip '+extfile, stdout=subprocess.PIPE, shell=True)
-                    pid = p.pid
-            elif self.gz:
-            # Call the command to untar the file.
-                if self.mswindows:
-                    tarfile.TarFile.extractall(f)
-                else:
-                    p = subprocess.Popen('tar -xf '+extfile, stdout=subprocess.PIPE, shell=True)
-                    pid = p.pid
-            
-            #No need to handle for windows because windows automatically replaces old files with new files. It does not ask the user(as it does in Mac/Unix)
-            if self.mswindows==False:
-                watch = threading.Timer(timeout, kill_process, args=(pid, kill_check, self.mswindows ))
-                watch.start()
-                (stdout, stderr) = p.communicate()
-                watch.cancel() # if it's still waiting to run
-                success = not kill_check.isSet()
-    
-                # Abort process if process fails.
-                if not success:
-                    raise RuntimeError
-                kill_check.clear()
-            print('Extraction Successful.')
-        except RuntimeError:
-            print "Ending the program"
-            sys.exit(1)
-        except:
-            print "Error during file extraction: ", sys.exc_info()[0]
-            raise
-
-    # Function to run the cfx testall comands and to make sure the SDK is not broken.
-    def run_testall(self, home_path, folder_name):
-        try:
-            timeout = 500
-
-            self.new_dir = home_path + folder_name
-            try:
-                os.chdir(self.new_dir)
-            except OSError:
-             # Will reach here if the jetpack 0.X directory doesnt exist
-                print 'O/S Error: Jetpack directory does not exist at ' + self.new_dir
-                raise
-            print '\nStarting tests...'
-            # Timeout code. The subprocess.popen exeutes the command and the thread waits for a timeout. If the process does not finish within the mentioned-
-            # timeout, the process is killed.
-            kill_check = threading.Event()
-
-            # Set the path for the logs. They will be in the parent directory of the Jetpack SDK.
-            log_path = home_path + 'tests.log'
-
-            # Subprocess call to set up the jetpack environment and to start the tests. Also sends the output to a log file.
-            if self.bin != None:
-                if self.mswindows:
-                    p = subprocess.Popen("bin\\activate && cfx testall -a firefox -b \"" + self.bin + "\"" , stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
-                    proc_handle = p._handle
-                    (stdout,stderr) = p.communicate()
-                else:
-                    p = subprocess.Popen('. bin/activate; cfx testall -a firefox -b ' + self.bin , stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
-                    pid = p.pid
-                    (stdout,stderr) = p.communicate()
-            elif self.bin == None:
-                if self.mswindows:
-                    p=subprocess.Popen('bin\\activate && cfx testall -a firefox > '+log_path, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
-                    proc_handle = p._handle
-                    (stdout,stderr) = p.communicate()
-                else:
-                    p = subprocess.Popen('. bin/activate; cfx testall -a firefox > '+log_path, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
-                    pid = p.pid
-                    (stdout,stderr) = p.communicate()
-                    
-            #Write the output to log file
-            f=open(log_path,"w")
-            f.write(stdout+stderr)
-            f.close()
-
-            #Watchdog for timeout process
-            if self.mswindows:
-                watch = threading.Timer(timeout, kill_process, args=(proc_handle, kill_check, self.mswindows))
-            else:
-                watch = threading.Timer(timeout, kill_process, args=(pid, kill_check, self.mswindows))
-            watch.start()
-            watch.cancel() # if it's still waiting to run
-            success = not kill_check.isSet()
-            if not success:
-                raise RuntimeError
-            kill_check.clear()
-        
-            if p.returncode!=0:
-                print('\nAll tests were not successful. Check the test-logs in the jetpack directory.')
-                result_sdk(home_path)
-                #sys.exit(1)
-                raise RuntimeError
-            else:
-                ret_code=result_sdk(home_path)
-                if ret_code==0:
-                    print('\nAll tests were successful. Yay \o/ . Running a sample package test now...')
-                else:
-                    print ('\nThere were errors during the tests.Take a look at logs')
-                    raise RuntimeError
-        except RuntimeError:
-            print "Ending the program"
-            sys.exit(1)
-        except:
-            print "Error during the testall command execution:", sys.exc_info()[0]
-            raise
-        
-    def package(self, example_dir):
-        try:
-            timeout = 30
-    
-            print '\nNow Running packaging tests...'
-    
-            kill_check = threading.Event()
-
-            # Set the path for the example logs. They will be in the parent directory of the Jetpack SDK.
-            exlog_path = example_dir + 'test-example.log'
-            # Subprocess call to test the sample example for packaging.
-            if self.bin!=None:
-                if self.mswindows:
-                    p = subprocess.Popen('bin\\activate && cfx run --pkgdir examples\\reading-data  --static-args="{\\"quitWhenDone\\":true}" -b \"" + self.bin + "\"' , stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
-                    proc_handle = p._handle
-                    (stdout, stderr) = p.communicate()
-                else:
-                    p = subprocess.Popen('. bin/activate; cfx run --pkgdir examples/reading-data  --static-args=\'{\"quitWhenDone\":true}\' -b ' + self.bin , stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
-                    pid = p.pid
-                    (stdout, stderr) = p.communicate()
-            elif self.bin==None:
-                if self.mswindows:
-                    p = subprocess.Popen('bin\\activate && cfx run  --pkgdir examples\\reading-data --static-args="{\\"quitWhenDone\\":true}"', stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
-                    proc_handle = p._handle
-                    (stdout, stderr) = p.communicate()
-                else:
-                    p = subprocess.Popen('. bin/activate; cfx run --pkgdir examples/reading-data --static-args=\'{\"quitWhenDone\":true}\' ', stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
-                    pid = p.pid
-                    (stdout, stderr) = p.communicate()
-            
-            #Write the output to log file
-            f=open(exlog_path,"w")
-            f.write(stdout+stderr)
-            f.close()
-            
-            #Watch dog for timeout process
-            if self.mswindows:
-                watch = threading.Timer(timeout, kill_process, args=(proc_handle, kill_check, self.mswindows))
-            else:
-                watch = threading.Timer(timeout, kill_process, args=(pid, kill_check, self.mswindows))
-            watch.start()
-            watch.cancel() # if it's still waiting to run
-            success = not kill_check.isSet()
-            if not success:
-                raise RuntimeError
-            kill_check.clear()
-
-            if p.returncode != 0:
-                print('\nSample tests were not executed correctly. Check the test-example log in jetpack diretory.')
-                result_example(example_dir)
-                raise RuntimeError
-            else:
-                ret_code=result_example(example_dir)
-                if ret_code==0:
-                    print('\nAll tests pass. The SDK is working! Yay \o/')
-                else:
-                    print ('\nTests passed with warning.Take a look at logs')
-                    sys.exit(1)
-        
-        except RuntimeError:
-            print "Ending program"
-            sys.exit(1)
-        except:
-            print "Error during running sample tests:", sys.exc_info()[0]
-            raise
-    
-def result_sdk(sdk_dir):
-    log_path = sdk_dir + 'tests.log'
-    print 'Results are logged at:' + log_path
-    try:
-        f = open(log_path,'r')
-    # Handles file errors
-    except IOError : 
-        print 'I/O error - Cannot open test log at ' + log_path
-        raise
-
-    for line in reversed(open(log_path).readlines()):
-        if line.strip()=='FAIL':
-            print ('\nOverall result - FAIL. Look at the test log at '+log_path)
-            return 1
-    return 0
-    
-
-def result_example(sdk_dir):
-    exlog_path = sdk_dir + 'test-example.log'
-    print 'Sample test results are logged at:' + exlog_path
-    try:
-        f = open(exlog_path,'r')
-    # Handles file errors
-    except IOError : 
-        print 'I/O error - Cannot open sample test log at ' + exlog_path
-        raise
-    
-    #Read the file in reverse and check for the keyword 'FAIL'.
-    for line in reversed(open(exlog_path).readlines()):
-        if line.strip()=='FAIL':
-            print ('\nOverall result for Sample tests - FAIL. Look at the test log at '+exlog_path)
-            return 1
-    return 0
-
-def kill_process(process, kill_check, mswindows):
-    print '\nProcess Timedout. Killing the process. Please Rerun this script.'
-    if mswindows:
-        win32api.TerminateProcess(process, -1)
-    else:
-        os.kill(process, signal.SIGKILL)
-    kill_check.set()# tell the main routine to kill. Used SIGKILL to hard kill the process.
-    return
-
-if __name__ == "__main__":
-    obj = SDK()
-    obj.download(obj.link,obj.fpath,obj.fname)
-    obj.extract(obj.base_path,obj.fname)
-    obj.run_testall(obj.base_path,obj.folder_name)
-    obj.package(obj.base_path)
deleted file mode 100644
--- a/addon-sdk/source/bin/jpm-test.js
+++ /dev/null
@@ -1,34 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-"use strict";
-
-var Promise = require("promise");
-var Mocha = require("mocha");
-var mocha = new Mocha({
-  ui: "bdd",
-  reporter: "spec",
-  timeout: 900000
-});
-
-var isDebug = require("./node-scripts/utils").isDebug;
-
-exports.run = function(type) {
-  return new Promise(function(resolve) {
-    type = type || "";
-    [
-      (!isDebug && /^(firefox-bin)?$/.test(type)) && require.resolve("../bin/node-scripts/test.firefox-bin"),
-      (!isDebug && /^(docs)?$/.test(type)) && require.resolve("../bin/node-scripts/test.docs"),
-      (!isDebug && /^(ini)?$/.test(type)) && require.resolve("../bin/node-scripts/test.ini"),
-      (/^(examples)?$/.test(type)) && require.resolve("../bin/node-scripts/test.examples"),
-      (!isDebug && /^(addons)?$/.test(type)) && require.resolve("../bin/node-scripts/test.addons"),
-      (!isDebug && /^(modules)?$/.test(type)) && require.resolve("../bin/node-scripts/test.modules"),
-    ].forEach(function(filepath) {
-      filepath && mocha.addFile(filepath);
-    })
-
-    mocha.run(function(failures) {
-      resolve(failures);
-    });
-  });
-}
deleted file mode 100644
--- a/addon-sdk/source/bin/node-scripts/apply-patch.js
+++ /dev/null
@@ -1,64 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-"use strict";
-
-var path = require("path");
-var cp = require("child_process");
-var fs = require("fs");
-var Promise = require("promise");
-var patcher = require("patch-editor");
-var readParam = require("./utils").readParam;
-
-var isKeeper = /\/addon-sdk\/source/;
-
-function apply(options) {
-  return clean(options).then(function() {
-    return new Promise(function(resolve) {
-      var patch = path.resolve(readParam("patch"));
-      var proc = cp.spawn("git", ["apply", patch]);
-      proc.stdout.pipe(process.stdout);
-      proc.stderr.pipe(process.stderr);
-      proc.on("close", resolve);
-    });
-  });
-}
-exports.apply = apply;
-
-function clean(options) {
-  return new Promise(function(resolve) {
-    var patch = path.resolve(readParam("patch"));
-    if (!patch) {
-      throw new Error("no --patch was provided.");
-    }
-    console.log("Cleaning patch " + patch);
-
-    patcher.getChunks({ patch: patch }).then(function(chunks) {
-      var keepers = [];
-
-      for (var i = chunks.length - 1; i >= 0; i--) {
-        var chunk = chunks[i];
-        var files = chunk.getFilesChanged();
-
-        // check if the file changed is related to the addon-sdk/source directory
-        var keepIt = files.map(function(file) {
-          return (isKeeper.test(file));
-        }).reduce(function(prev, curr) {
-          return prev || curr;
-        }, false);
-
-        if (keepIt) {
-          keepers.push(chunk);
-        }
-      }
-
-      var contents = "\n" + keepers.join("\n") + "\n";
-      contents = contents.replace(/\/addon-sdk\/source/g, "");
-
-      fs.writeFileSync(patch, contents, { encoding: "utf8" });
-
-      console.log("Done cleaning patch.");
-    }).then(resolve).catch(console.error);
-  });
-}
-exports.clean = clean;
deleted file mode 100644
--- a/addon-sdk/source/bin/node-scripts/test.addons.js
+++ /dev/null
@@ -1,57 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-"use strict";
-
-var utils = require("./utils");
-var path = require("path");
-var fs = require("fs");
-var jpm = utils.run;
-var readParam = utils.readParam;
-var isDebug = utils.isDebug;
-
-var addonsPath = path.join(__dirname, "..", "..", "test", "addons");
-
-var binary = process.env.JPM_FIREFOX_BINARY || "nightly";
-var filterPattern = readParam("filter");
-
-describe("jpm test sdk addons", function () {
-  fs.readdirSync(addonsPath)
-  .filter(fileFilter.bind(null, addonsPath))
-  .forEach(function (file) {
-    it(file, function (done) {
-      var addonPath = path.join(addonsPath, file);
-      process.chdir(addonPath);
-
-      var options = { cwd: addonPath, env: { JPM_FIREFOX_BINARY: binary }};
-      if (process.env.DISPLAY) {
-        options.env.DISPLAY = process.env.DISPLAY;
-      }
-      if (/^e10s/.test(file)) {
-        options.e10s = true;
-      }
-
-      jpm("run", options).then(done).catch(done);
-    });
-  });
-});
-
-function fileFilter(root, file) {
-  var matcher = filterPattern && new RegExp(filterPattern);
-  if (/^(l10n-properties|simple-prefs|page-mod-debugger)/.test(file)) {
-    return false;
-  }
-
-  // filter additional add-ons when using debug builds
-  if (isDebug) {
-    if (/^(chrome|e10s)/.test(file)) {
-      return false;
-    }
-  }
-
-  if (matcher && !matcher.test(file)) {
-    return false;
-  }
-  var stat = fs.statSync(path.join(root, file))
-  return (stat && stat.isDirectory());
-}
deleted file mode 100644
--- a/addon-sdk/source/bin/node-scripts/test.docs.js
+++ /dev/null
@@ -1,145 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-"use strict";
-
-var createHash = require('crypto').createHash;
-var fs = require("fs");
-var fsExtra = require("fs-extra")
-var path = require("path");
-var Promise = require("promise");
-var chai = require("chai");
-var expect = chai.expect;
-var teacher = require("teacher");
-
-var rootURI = path.join(__dirname, "..", "..");
-
-// get a list of words that fail spell check but are still acceptable
-var NEW_WORDS = fs.readFileSync(path.join(__dirname, "words.txt")).toString().trim().split("\n");
-
-var CACHE_PATH = path.join(__dirname, "..", "..", "cache", "spellchecks.json");
-
-var CACHE = {};
-
-try {
-  CACHE = JSON.parse(fs.readFileSync(CACHE_PATH).toString());
-}
-catch (e) {}
-
-function md5(str) {
-  return createHash("md5").update(str).digest("utf8");
-}
-
-function addCacheHash(hash) {
-  CACHE[hash] = true;
-  fsExtra.ensureFileSync(CACHE_PATH);
-  fsExtra.writeJSONSync(CACHE_PATH, CACHE);
-}
-
-describe("Spell Checking", function () {
-  it("Spellcheck CONTRIBUTING.md", function (done) {
-   var readme = path.join(rootURI, "CONTRIBUTING.md");
-
-    fs.readFile(readme, function (err, data) {
-      if (err) {
-        throw err;
-      }
-      var text = data.toString();
-      var hash = md5(text);
-
-      // skip this test if we know we have done the
-      // exact same test with positive results before
-      if (CACHE[hash]) {
-        expect(CACHE[hash]).to.be.equal(true);
-        return done();
-      }
-
-      teacher.check(text, function(err, data) {
-        expect(err).to.be.equal(null);
-
-        var results = data || [];
-        results = results.filter(function(result) {
-          if (NEW_WORDS.indexOf(result.string.toLowerCase()) != -1) {
-            return false;
-          }
-
-          // ignore anything that starts with a dash
-          if (result.string[0] == "-") {
-            return false;
-          }
-
-          if (!(new RegExp(result.string)).test(text)) {
-            return false;
-          }
-
-          return true;
-        })
-
-        if (results.length > 0) {
-          console.log(results);
-        }
-        else {
-          addCacheHash(hash);
-        }
-
-        expect(results.length).to.be.equal(0);
-
-        setTimeout(done, 500);
-      });
-    });
-  });
-
-  it("Spellcheck README.md", function (done) {
-   var readme = path.join(rootURI, "README.md");
-
-    fs.readFile(readme, function (err, data) {
-      if (err) {
-        throw err;
-      }
-      var text = data.toString();
-      var hash = md5(text);
-
-      // skip this test if we know we have done the
-      // exact same test with positive results before
-      if (CACHE[hash]) {
-        expect(CACHE[hash]).to.be.equal(true);
-        return done();
-      }
-
-      teacher.check(text, function(err, data) {
-        expect(err).to.be.equal(null);
-
-        var results = data || [];
-        results = results.filter(function(result) {
-          if (NEW_WORDS.indexOf(result.string.toLowerCase()) != -1) {
-            return false;
-          }
-
-          // ignore anything that starts with a dash
-          if (result.string[0] == "-") {
-            return false;
-          }
-
-          // ignore anything that we don't find in the original text,
-          // for some reason "bootstrap.js" becomes "bootstrapjs".
-          if (!(new RegExp(result.string)).test(text)) {
-            return false;
-          }
-
-          return true;
-        })
-
-        if (results.length > 0) {
-          console.log(results);
-        }
-        else {
-          addCacheHash(hash);
-        }
-
-        expect(results.length).to.be.equal(0);
-
-        done();
-      });
-    });
-  });
-});
deleted file mode 100644
--- a/addon-sdk/source/bin/node-scripts/test.examples.js
+++ /dev/null
@@ -1,45 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-"use strict";
-
-var utils = require("./utils");
-var path = require("path");
-var fs = require("fs");
-var jpm = utils.run;
-var readParam = utils.readParam;
-
-var examplesPath = path.join(__dirname, "..", "..", "examples");
-
-var binary = process.env.JPM_FIREFOX_BINARY || "nightly";
-var filterPattern = readParam("filter");
-
-describe("jpm test sdk examples", function () {
-  fs.readdirSync(examplesPath)
-  .filter(fileFilter.bind(null, examplesPath))
-  .forEach(function (file) {
-    it(file, function (done) {
-      var addonPath = path.join(examplesPath, file);
-      process.chdir(addonPath);
-
-      var options = { cwd: addonPath, env: { JPM_FIREFOX_BINARY: binary }};
-      if (process.env.DISPLAY) {
-        options.env.DISPLAY = process.env.DISPLAY;
-      }
-
-      jpm("test", options).then(done);
-    });
-  });
-});
-
-function fileFilter(root, file) {
-  var matcher = filterPattern && new RegExp(filterPattern);
-  if (/^(reading-data)/.test(file)) {
-    return false;
-  }
-  if (matcher && !matcher.test(file)) {
-    return false;
-  }
-  var stat = fs.statSync(path.join(root, file))
-  return (stat && stat.isDirectory());
-}
deleted file mode 100644
--- a/addon-sdk/source/bin/node-scripts/test.firefox-bin.js
+++ /dev/null
@@ -1,37 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-"use strict";
-
-var fs = require("fs");
-var Promise = require("promise");
-var chai = require("chai");
-var expect = chai.expect;
-var normalizeBinary = require("fx-runner/lib/utils").normalizeBinary;
-
-//var firefox_binary = process.env["JPM_FIREFOX_BINARY"] || normalizeBinary("nightly");
-
-describe("Checking Firefox binary", function () {
-
-  it("using matching fx-runner version with jpm", function () {
-    var sdkPackageJSON = require("../../package.json");
-    var jpmPackageINI = require("jpm/package.json");
-    expect(sdkPackageJSON.devDependencies["fx-runner"]).to.be.equal(jpmPackageINI.dependencies["fx-runner"]);
-  });
-
-  it("exists", function (done) {
-    var useEnvVar = new Promise(function(resolve) {
-      resolve(process.env["JPM_FIREFOX_BINARY"]);
-    });
-
-    var firefox_binary = process.env["JPM_FIREFOX_BINARY"] ? useEnvVar : normalizeBinary("nightly");
-    firefox_binary.then(function(path) {
-      expect(path).to.be.ok;
-      fs.exists(path, function (exists) {
-        expect(exists).to.be.ok;
-        done();
-      });
-    })
-  });
-
-});
deleted file mode 100644
--- a/addon-sdk/source/bin/node-scripts/test.ini.js
+++ /dev/null
@@ -1,68 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-"use strict";
-
-var fs = require("fs");
-var path = require("path");
-var Promise = require("promise");
-var chai = require("chai");
-var expect = chai.expect;
-var ini = require("./update-ini");
-
-var addonINI = path.resolve("./test/addons/jetpack-addon.ini");
-var packageINI = path.resolve("./test/jetpack-package.ini");
-
-describe("Checking ini files", function () {
-
-  it("Check test/addons/jetpack-addon.ini", function (done) {
-
-    fs.readFile(addonINI, function (err, data) {
-      if (err) {
-        throw err;
-      }
-      // filter comments
-      var text = data.toString().split("\n").filter(function(line) {
-        return !/^\s*#/.test(line);
-      }).join("\n");
-      var expected = "";
-
-      ini.makeAddonIniContent()
-      .then(function(contents) {
-        expected = contents;
-
-        setTimeout(function end() {
-          expect(text.trim()).to.be.equal(expected.trim());
-          done();
-        });
-      });
-    });
-
-  });
-
-  it("Check test/jetpack-package.ini", function (done) {
-
-    fs.readFile(packageINI, function (err, data) {
-      if (err) {
-        throw err;
-      }
-      // filter comments
-      var text = data.toString().split("\n").filter(function(line) {
-        return !/^\s*#/.test(line);
-      }).join("\n");
-      var expected = "";
-
-      ini.makePackageIniContent()
-      .then(function(contents) {
-        expected = contents;
-
-        setTimeout(function end() {
-          expect(text.trim()).to.be.equal(expected.trim());
-          done();
-        });
-      });
-    });
-
-  });
-
-});
deleted file mode 100644
--- a/addon-sdk/source/bin/node-scripts/test.modules.js
+++ /dev/null
@@ -1,28 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-"use strict";
-
-var utils = require("./utils");
-var readParam = utils.readParam;
-var path = require("path");
-var fs = require("fs");
-var jpm = utils.run;
-var sdk = path.join(__dirname, "..", "..");
-var binary = process.env.JPM_FIREFOX_BINARY || "nightly";
-
-var filterPattern = readParam("filter");
-
-describe("jpm test sdk modules", function () {
-  it("SDK Modules", function (done) {
-    process.chdir(sdk);
-
-    var options = { cwd: sdk, env: { JPM_FIREFOX_BINARY: binary } };
-    if (process.env.DISPLAY) {
-      options.env.DISPLAY = process.env.DISPLAY;
-    }
-    options.filter = filterPattern;
-
-    jpm("test", options, process).then(done);
-  });
-});
deleted file mode 100644
--- a/addon-sdk/source/bin/node-scripts/update-ini.js
+++ /dev/null
@@ -1,141 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-"use strict";
-
-var path = require("path");
-var cp = require("child_process");
-var fs = require("fs");
-var Promise = require("promise");
-var parser = require("ini-parser");
-
-var addonINI = path.resolve("./test/addons/jetpack-addon.ini");
-var addonsDir = path.resolve("./test/addons/");
-var packageINI = path.resolve("./test/jetpack-package.ini");
-var packageDir = path.resolve("./test/");
-var packageIgnorables = [ "addons", "preferences" ];
-var packageSupportFiles = [
-  "fixtures.js",
-  "test-context-menu.html",
-  "util.js"
-]
-
-function updateAddonINI() {
-  return new Promise(function(resolve) {
-    console.log("Start updating " + addonINI);
-
-    makeAddonIniContent().
-    then(function(contents) {
-      fs.writeFileSync(addonINI, contents, { encoding: "utf8" });
-      console.log("Done updating " + addonINI);
-      resolve();
-    });
-  })
-}
-exports.updateAddonINI = updateAddonINI;
-
-function makeAddonIniContent() {
-  return new Promise(function(resolve) {
-    var data = parser.parse(fs.readFileSync(addonINI, { encoding: "utf8" }).toString());
-    var result = {};
-
-    fs.readdir(addonsDir, function(err, files) {
-      // get a list of folders
-      var folders = files.filter(function(file) {
-        return fs.statSync(path.resolve(addonsDir, file)).isDirectory();
-      }).sort();
-
-      // copy any related data from the existing ini
-      folders.forEach(function(folder) {
-        var oldData = data[folder + ".xpi"];
-        result[folder] = oldData ? oldData : {};
-      });
-
-      // build a new ini file
-      var contents = [];
-      Object.keys(result).sort().forEach(function(key) {
-        contents.push("[" + key + ".xpi]");
-        Object.keys(result[key]).forEach(function(dataKey) {
-          contents.push(dataKey + " = " + result[key][dataKey]);
-        });
-      });
-      contents = contents.join("\n") + "\n";
-
-      return resolve(contents);
-    });
-  });
-}
-exports.makeAddonIniContent = makeAddonIniContent;
-
-function makePackageIniContent() {
-  return new Promise(function(resolve) {
-    var data = parser.parse(fs.readFileSync(packageINI, { encoding: "utf8" }).toString());
-    var result = {};
-
-    fs.readdir(packageDir, function(err, files) {
-      // get a list of folders
-      var folders = files.filter(function(file) {
-        var ignore = (packageIgnorables.indexOf(file) >= 0);
-        var isDir = fs.statSync(path.resolve(packageDir, file)).isDirectory();
-        return (isDir && !ignore);
-      }).sort();
-
-      // get a list of "test-"" files
-      var files = files.filter(function(file) {
-        var ignore = !/^test\-.*\.js$/i.test(file);
-        var isDir = fs.statSync(path.resolve(packageDir, file)).isDirectory();
-        return (!isDir && !ignore);
-      }).sort();
-
-      // get a list of the support files
-      var support_files = packageSupportFiles.map(function(file) {
-        return "  " + file;
-      });
-      folders.forEach(function(folder) {
-        support_files.push("  " + folder + "/**");
-      });
-      support_files = support_files.sort();
-
-      // copy any related data from the existing ini
-      files.forEach(function(file) {
-        var oldData = data[file];
-        result[file] = oldData ? oldData : {};
-      });
-
-      // build a new ini file
-      var contents = [
-        "[DEFAULT]",
-        "support-files ="
-      ];
-      support_files.forEach(function(support_file) {
-        contents.push(support_file);
-      });
-      contents.push("");
-
-      Object.keys(result).sort().forEach(function(key) {
-        contents.push("[" + key + "]");
-        Object.keys(result[key]).forEach(function(dataKey) {
-          contents.push(dataKey + " = " + result[key][dataKey]);
-        });
-      });
-      contents = contents.join("\n") + "\n";
-
-      return resolve(contents);
-    });
-  });
-}
-exports.makePackageIniContent = makePackageIniContent;
-
-function updatePackageINI() {
-  return new Promise(function(resolve) {
-    console.log("Start updating " + packageINI);
-
-    makeAddonIniContent().
-    then(function(contents) {
-      fs.writeFileSync(packageINI, contents, { encoding: "utf8" });
-      console.log("Done updating " + packageINI);
-      resolve();
-    });
-  })
-}
-exports.updatePackageINI = updatePackageINI;
deleted file mode 100644
--- a/addon-sdk/source/bin/node-scripts/utils.js
+++ /dev/null
@@ -1,104 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-"use strict";
-
-var _ = require("lodash");
-var path = require("path");
-var child_process = require("child_process");
-var jpm = require.resolve("../../node_modules/jpm/bin/jpm");
-var Promise = require("promise");
-var chai = require("chai");
-var expect = chai.expect;
-var assert = chai.assert;
-var DEFAULT_PROCESS = process;
-
-var sdk = path.join(__dirname, "..", "..");
-var prefsPath = path.join(sdk, "test", "preferences", "test-preferences.js");
-var e10sPrefsPath = path.join(sdk, "test", "preferences", "test-e10s-preferences.js");
-
-var OUTPUT_FILTERS = [
-  /[^\n\r]+WARNING\: NS_ENSURE_SUCCESS\(rv, rv\) failed[^\n]+\n\r?/
-];
-
-var isDebug = (process.env["JPM_FX_DEBUG"] == "1");
-exports.isDebug = isDebug;
-
-function spawn (cmd, options) {
-  options = options || {};
-  var env = _.extend({}, options.env, process.env);
-
-  if (isDebug) {
-    env["MOZ_QUIET"] = 1;
-  }
-
-  var e10s = options.e10s || false;
-
-  return child_process.spawn("node", [
-    jpm, cmd, "-v", "--tbpl",
-    "--prefs", e10s ? e10sPrefsPath : prefsPath,
-    "-o", sdk,
-    "-f", options.filter || ""
-  ], {
-    cwd: options.cwd || tmpOutputDir,
-    env: env
-  });
-}
-exports.spawn = spawn;
-
-function run (cmd, options, p) {
-  return new Promise(function(resolve) {
-    var output = [];
-
-    var proc = spawn(cmd, options);
-    proc.stderr.pipe(process.stderr);
-    proc.stdout.on("data", function (data) {
-      for (var i = OUTPUT_FILTERS.length - 1; i >= 0; i--) {
-        if (OUTPUT_FILTERS[i].test(data)) {
-          return null;
-        }
-      }
-      output.push(data);
-      return null;
-    });
-
-    if (p) {
-      proc.stdout.pipe(p.stdout);
-    }
-    else if (!isDebug) {
-      proc.stdout.pipe(DEFAULT_PROCESS.stdout);
-    }
-    else {
-      proc.stdout.on("data", function (data) {
-        data = (data || "") + "";
-        if (/TEST-/.test(data)) {
-          DEFAULT_PROCESS.stdout.write(data.replace(/[\s\n]+$/, "") + "\n");
-        }
-      });
-    }
-
-    proc.on("close", function(code) {
-      var out = output.join("");
-      var buildDisplayed = /Build \d+/.test(out);
-      var noTests = /No tests were run/.test(out);
-      var hasSuccess = /All tests passed!/.test(out);
-      var hasFailure = /There were test failures\.\.\./.test(out);
-      if (noTests || hasFailure || !hasSuccess || code != 0) {
-        DEFAULT_PROCESS.stdout.write(out);
-      }
-      expect(code).to.equal(hasFailure ? 1 : 0);
-      expect(buildDisplayed).to.equal(true);
-      expect(hasFailure).to.equal(false);
-      expect(hasSuccess).to.equal(true);
-      expect(noTests).to.equal(false);
-      resolve();
-    });
-  });
-}
-exports.run = run;
-
-function readParam(name) {
-  var index = process.argv.indexOf("--" + name)
-  return index >= 0 && process.argv[index + 1]
-}
-exports.readParam = readParam;
deleted file mode 100644
--- a/addon-sdk/source/bin/node-scripts/words.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-addon-sdk
-github
-stackoverflow
-bugzilla
-irc
-jsantell
-mossop
-gozala
-zer0
-autonome
-0c0w3
deleted file mode 100644
--- a/addon-sdk/source/examples/actor-repl/README.md
+++ /dev/null
@@ -1,3 +0,0 @@
-# Actor REPL
-
-Simple REPL for a Firefox debugging protocol.
deleted file mode 100644
--- a/addon-sdk/source/examples/actor-repl/data/codemirror-compressed.js
+++ /dev/null
@@ -1,5 +0,0 @@
-window.CodeMirror=function(){"use strict";function z(a,c){if(!(this instanceof z))return new z(a,c);this.options=c=c||{};for(var d in fd)!c.hasOwnProperty(d)&&fd.hasOwnProperty(d)&&(c[d]=fd[d]);M(c);var e="string"==typeof c.value?0:c.value.first,f=this.display=A(a,e);f.wrapper.CodeMirror=this,J(this),c.autofocus&&!r&&Qb(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,draggingText:!1,highlight:new jf},H(this),c.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap");var g=c.value;"string"==typeof g&&(g=new te(c.value,c.mode)),Ib(this,xe)(this,g),b&&setTimeout(tf(Pb,this,!0),20),Tb(this);var h;try{h=document.activeElement==f.input}catch(i){}h||c.autofocus&&!r?setTimeout(tf(rc,this),20):sc(this),Ib(this,function(){for(var a in ed)ed.propertyIsEnumerable(a)&&ed[a](this,c[a],hd);for(var b=0;b<ld.length;++b)ld[b](this)})()}function A(a,b){var d={},e=d.input=zf("textarea",null,null,"position: absolute; padding: 0; width: 1px; height: 1em; outline: none");return h?e.style.width="1000px":e.setAttribute("wrap","off"),q&&(e.style.border="1px solid black"),e.setAttribute("autocorrect","off"),e.setAttribute("autocapitalize","off"),e.setAttribute("spellcheck","false"),d.inputDiv=zf("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;"),d.scrollbarH=zf("div",[zf("div",null,null,"height: 1px")],"CodeMirror-hscrollbar"),d.scrollbarV=zf("div",[zf("div",null,null,"width: 1px")],"CodeMirror-vscrollbar"),d.scrollbarFiller=zf("div",null,"CodeMirror-scrollbar-filler"),d.gutterFiller=zf("div",null,"CodeMirror-gutter-filler"),d.lineDiv=zf("div",null,"CodeMirror-code"),d.selectionDiv=zf("div",null,null,"position: relative; z-index: 1"),d.cursor=zf("div","\xa0","CodeMirror-cursor"),d.otherCursor=zf("div","\xa0","CodeMirror-cursor CodeMirror-secondarycursor"),d.measure=zf("div",null,"CodeMirror-measure"),d.lineSpace=zf("div",[d.measure,d.selectionDiv,d.lineDiv,d.cursor,d.otherCursor],null,"position: relative; outline: none"),d.mover=zf("div",[zf("div",[d.lineSpace],"CodeMirror-lines")],null,"position: relative"),d.sizer=zf("div",[d.mover],"CodeMirror-sizer"),d.heightForcer=zf("div",null,null,"position: absolute; height: "+gf+"px; width: 1px;"),d.gutters=zf("div",null,"CodeMirror-gutters"),d.lineGutter=null,d.scroller=zf("div",[d.sizer,d.heightForcer,d.gutters],"CodeMirror-scroll"),d.scroller.setAttribute("tabIndex","-1"),d.wrapper=zf("div",[d.inputDiv,d.scrollbarH,d.scrollbarV,d.scrollbarFiller,d.gutterFiller,d.scroller],"CodeMirror"),c&&(d.gutters.style.zIndex=-1,d.scroller.style.paddingRight=0),a.appendChild?a.appendChild(d.wrapper):a(d.wrapper),q&&(e.style.width="0px"),h||(d.scroller.draggable=!0),m?(d.inputDiv.style.height="1px",d.inputDiv.style.position="absolute"):c&&(d.scrollbarH.style.minWidth=d.scrollbarV.style.minWidth="18px"),d.viewOffset=d.lastSizeC=0,d.showingFrom=d.showingTo=b,d.lineNumWidth=d.lineNumInnerWidth=d.lineNumChars=null,d.prevInput="",d.alignWidgets=!1,d.pollingFast=!1,d.poll=new jf,d.cachedCharWidth=d.cachedTextHeight=d.cachedPaddingH=null,d.measureLineCache=[],d.measureLineCachePos=0,d.inaccurateSelection=!1,d.maxLine=null,d.maxLineLength=0,d.maxLineChanged=!1,d.wheelDX=d.wheelDY=d.wheelStartX=d.wheelStartY=null,d}function B(a){a.doc.mode=z.getMode(a.options,a.doc.modeOption),C(a)}function C(a){a.doc.iter(function(a){a.stateAfter&&(a.stateAfter=null),a.styles&&(a.styles=null)}),a.doc.frontier=a.doc.first,eb(a,100),a.state.modeGen++,a.curOp&&Lb(a)}function D(a){a.options.lineWrapping?(a.display.wrapper.className+=" CodeMirror-wrap",a.display.sizer.style.minWidth=""):(a.display.wrapper.className=a.display.wrapper.className.replace(" CodeMirror-wrap",""),L(a)),F(a),Lb(a),sb(a),setTimeout(function(){N(a)},100)}function E(a){var b=Db(a.display),c=a.options.lineWrapping,d=c&&Math.max(5,a.display.scroller.clientWidth/Eb(a.display)-3);return function(e){if(Sd(a.doc,e))return 0;var f=0;if(e.widgets)for(var g=0;g<e.widgets.length;g++)e.widgets[g].height&&(f+=e.widgets[g].height);return c?f+(Math.ceil(e.text.length/d)||1)*b:f+b}}function F(a){var b=a.doc,c=E(a);b.iter(function(a){var b=c(a);b!=a.height&&Be(a,b)})}function G(a){var b=qd[a.options.keyMap],c=b.style;a.display.wrapper.className=a.display.wrapper.className.replace(/\s*cm-keymap-\S+/g,"")+(c?" cm-keymap-"+c:"")}function H(a){a.display.wrapper.className=a.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+a.options.theme.replace(/(^|\s)\s*/g," cm-s-"),sb(a)}function I(a){J(a),Lb(a),setTimeout(function(){P(a)},20)}function J(a){var b=a.display.gutters,c=a.options.gutters;Af(b);for(var d=0;d<c.length;++d){var e=c[d],f=b.appendChild(zf("div",null,"CodeMirror-gutter "+e));"CodeMirror-linenumbers"==e&&(a.display.lineGutter=f,f.style.width=(a.display.lineNumWidth||1)+"px")}b.style.display=d?"":"none"}function K(a,b){if(0==b.height)return 0;for(var d,c=b.text.length,e=b;d=Od(e);){var f=d.find();e=ye(a,f.from.line),c+=f.from.ch-f.to.ch}for(e=b;d=Pd(e);){var f=d.find();c-=e.text.length-f.from.ch,e=ye(a,f.to.line),c+=e.text.length-f.to.ch}return c}function L(a){var b=a.display,c=a.doc;b.maxLine=ye(c,c.first),b.maxLineLength=K(c,b.maxLine),b.maxLineChanged=!0,c.iter(function(a){var d=K(c,a);d>b.maxLineLength&&(b.maxLineLength=d,b.maxLine=a)})}function M(a){var b=pf(a.gutters,"CodeMirror-linenumbers");-1==b&&a.lineNumbers?a.gutters=a.gutters.concat(["CodeMirror-linenumbers"]):b>-1&&!a.lineNumbers&&(a.gutters=a.gutters.slice(0),a.gutters.splice(b,1))}function N(a){var b=a.display,c=a.doc.height,d=c+jb(b);b.sizer.style.minHeight=b.heightForcer.style.top=d+"px",b.gutters.style.height=Math.max(d,b.scroller.clientHeight-gf)+"px";var e=Math.max(d,b.scroller.scrollHeight),f=b.scroller.scrollWidth>b.scroller.clientWidth+1,g=e>b.scroller.clientHeight+1;g?(b.scrollbarV.style.display="block",b.scrollbarV.style.bottom=f?Hf(b.measure)+"px":"0",b.scrollbarV.firstChild.style.height=Math.max(0,e-b.scroller.clientHeight+b.scrollbarV.clientHeight)+"px"):(b.scrollbarV.style.display="",b.scrollbarV.firstChild.style.height="0"),f?(b.scrollbarH.style.display="block",b.scrollbarH.style.right=g?Hf(b.measure)+"px":"0",b.scrollbarH.firstChild.style.width=b.scroller.scrollWidth-b.scroller.clientWidth+b.scrollbarH.clientWidth+"px"):(b.scrollbarH.style.display="",b.scrollbarH.firstChild.style.width="0"),f&&g?(b.scrollbarFiller.style.display="block",b.scrollbarFiller.style.height=b.scrollbarFiller.style.width=Hf(b.measure)+"px"):b.scrollbarFiller.style.display="",f&&a.options.coverGutterNextToScrollbar&&a.options.fixedGutter?(b.gutterFiller.style.display="block",b.gutterFiller.style.height=Hf(b.measure)+"px",b.gutterFiller.style.width=b.gutters.offsetWidth+"px"):b.gutterFiller.style.display="",n&&0===Hf(b.measure)&&(b.scrollbarV.style.minWidth=b.scrollbarH.style.minHeight=o?"18px":"12px",b.scrollbarV.style.pointerEvents=b.scrollbarH.style.pointerEvents="none")}function O(a,b,c){var d=a.scroller.scrollTop,e=a.wrapper.clientHeight;"number"==typeof c?d=c:c&&(d=c.top,e=c.bottom-c.top),d=Math.floor(d-ib(a));var f=Math.ceil(d+e);return{from:De(b,d),to:De(b,f)}}function P(a){var b=a.display;if(b.alignWidgets||b.gutters.firstChild&&a.options.fixedGutter){for(var c=S(b)-b.scroller.scrollLeft+a.doc.scrollLeft,d=b.gutters.offsetWidth,e=c+"px",f=b.lineDiv.firstChild;f;f=f.nextSibling)if(f.alignable)for(var g=0,h=f.alignable;g<h.length;++g)h[g].style.left=e;a.options.fixedGutter&&(b.gutters.style.left=c+d+"px")}}function Q(a){if(!a.options.lineNumbers)return!1;var b=a.doc,c=R(a.options,b.first+b.size-1),d=a.display;if(c.length!=d.lineNumChars){var e=d.measure.appendChild(zf("div",[zf("div",c)],"CodeMirror-linenumber CodeMirror-gutter-elt")),f=e.firstChild.offsetWidth,g=e.offsetWidth-f;return d.lineGutter.style.width="",d.lineNumInnerWidth=Math.max(f,d.lineGutter.offsetWidth-g),d.lineNumWidth=d.lineNumInnerWidth+g,d.lineNumChars=d.lineNumInnerWidth?c.length:-1,d.lineGutter.style.width=d.lineNumWidth+"px",!0}return!1}function R(a,b){return String(a.lineNumberFormatter(b+a.firstLineNumber))}function S(a){return Df(a.scroller).left-Df(a.sizer).left}function T(a,b,c,d){for(var g,e=a.display.showingFrom,f=a.display.showingTo,h=O(a.display,a.doc,c),i=!0;;i=!1){var j=a.display.scroller.clientWidth;if(!U(a,b,h,d))break;if(g=!0,b=[],ab(a),N(a),i&&a.options.lineWrapping&&j!=a.display.scroller.clientWidth)d=!0;else if(d=!1,c&&(c=Math.min(a.display.scroller.scrollHeight-a.display.scroller.clientHeight,"number"==typeof c?c:c.top)),h=O(a.display,a.doc,c),h.from>=a.display.showingFrom&&h.to<=a.display.showingTo)break}return g&&(bf(a,"update",a),(a.display.showingFrom!=e||a.display.showingTo!=f)&&bf(a,"viewportChange",a,a.display.showingFrom,a.display.showingTo)),g}function U(a,b,c,d){var e=a.display,f=a.doc;if(!e.wrapper.offsetWidth)return e.showingFrom=e.showingTo=f.first,e.viewOffset=0,void 0;if(!(!d&&0==b.length&&c.from>e.showingFrom&&c.to<e.showingTo)){Q(a)&&(b=[{from:f.first,to:f.first+f.size}]);var g=e.sizer.style.marginLeft=e.gutters.offsetWidth+"px";e.scrollbarH.style.left=a.options.fixedGutter?g:"0";var h=1/0;if(a.options.lineNumbers)for(var i=0;i<b.length;++i)b[i].diff&&b[i].from<h&&(h=b[i].from);var j=f.first+f.size,k=Math.max(c.from-a.options.viewportMargin,f.first),l=Math.min(j,c.to+a.options.viewportMargin);if(e.showingFrom<k&&k-e.showingFrom<20&&(k=Math.max(f.first,e.showingFrom)),e.showingTo>l&&e.showingTo-l<20&&(l=Math.min(j,e.showingTo)),y)for(k=Ce(Rd(f,ye(f,k)));j>l&&Sd(f,ye(f,l));)++l;var m=[{from:Math.max(e.showingFrom,f.first),to:Math.min(e.showingTo,j)}];if(m=m[0].from>=m[0].to?[]:X(m,b),y)for(var i=0;i<m.length;++i)for(var o,n=m[i];o=Pd(ye(f,n.to-1));){var p=o.find().from.line;if(!(p>n.from)){m.splice(i--,1);break}n.to=p}for(var q=0,i=0;i<m.length;++i){var n=m[i];n.from<k&&(n.from=k),n.to>l&&(n.to=l),n.from>=n.to?m.splice(i--,1):q+=n.to-n.from}if(!d&&q==l-k&&k==e.showingFrom&&l==e.showingTo)return W(a),void 0;m.sort(function(a,b){return a.from-b.from});try{var r=document.activeElement}catch(s){}.7*(l-k)>q&&(e.lineDiv.style.display="none"),Z(a,k,l,m,h),e.lineDiv.style.display="",r&&document.activeElement!=r&&r.offsetHeight&&r.focus();var t=k!=e.showingFrom||l!=e.showingTo||e.lastSizeC!=e.wrapper.clientHeight;return t&&(e.lastSizeC=e.wrapper.clientHeight,eb(a,400)),e.showingFrom=k,e.showingTo=l,e.gutters.style.height="",V(a),W(a),!0}}function V(a){for(var f,b=a.display,d=b.lineDiv.offsetTop,e=b.lineDiv.firstChild;e;e=e.nextSibling)if(e.lineObj){if(c){var g=e.offsetTop+e.offsetHeight;f=g-d,d=g}else{var h=Df(e);f=h.bottom-h.top}var i=e.lineObj.height-f;if(2>f&&(f=Db(b)),i>.001||-.001>i){Be(e.lineObj,f);var j=e.lineObj.widgets;if(j)for(var k=0;k<j.length;++k)j[k].height=j[k].node.offsetHeight}}}function W(a){var b=a.display.viewOffset=Ee(a,ye(a.doc,a.display.showingFrom));a.display.mover.style.top=b+"px"}function X(a,b){for(var c=0,d=b.length||0;d>c;++c){for(var e=b[c],f=[],g=e.diff||0,h=0,i=a.length;i>h;++h){var j=a[h];e.to<=j.from&&e.diff?f.push({from:j.from+g,to:j.to+g}):e.to<=j.from||e.from>=j.to?f.push(j):(e.from>j.from&&f.push({from:j.from,to:e.from}),e.to<j.to&&f.push({from:e.to+g,to:j.to+g}))}a=f}return a}function Y(a){for(var b=a.display,c={},d={},e=b.gutters.firstChild,f=0;e;e=e.nextSibling,++f)c[a.options.gutters[f]]=e.offsetLeft,d[a.options.gutters[f]]=e.offsetWidth;return{fixedPos:S(b),gutterTotalWidth:b.gutters.offsetWidth,gutterLeft:c,gutterWidth:d,wrapperWidth:b.wrapper.clientWidth}}function Z(a,b,c,d,e){function l(b){var c=b.nextSibling;return h&&s&&a.display.currentWheelTarget==b?(b.style.display="none",b.lineObj=null):b.parentNode.removeChild(b),c}var f=Y(a),g=a.display,i=a.options.lineNumbers;d.length||h&&a.display.currentWheelTarget||Af(g.lineDiv);var j=g.lineDiv,k=j.firstChild,m=d.shift(),n=b;for(a.doc.iter(b,c,function(b){if(m&&m.to==n&&(m=d.shift()),Sd(a.doc,b)){if(0!=b.height&&Be(b,0),b.widgets&&k&&k.previousSibling)for(var c=0;c<b.widgets.length;++c){var g=b.widgets[c];if(g.showIfHidden){var h=k.previousSibling;if(/pre/i.test(h.nodeName)){var o=zf("div",null,null,"position: relative");h.parentNode.replaceChild(o,h),o.appendChild(h),h=o}var p=h.appendChild(zf("div",[g.node],"CodeMirror-linewidget"));g.handleMouseEvents||(p.ignoreEvents=!0),_(g,p,h,f)}}}else if(m&&m.from<=n&&m.to>n){for(;k.lineObj!=b;)k=l(k);i&&n>=e&&k.lineNumber&&Cf(k.lineNumber,R(a.options,n)),k=k.nextSibling}else{if(b.widgets)for(var s,q=0,r=k;r&&20>q;++q,r=r.nextSibling)if(r.lineObj==b&&/div/i.test(r.nodeName)){s=r;break}var t=$(a,b,n,f,s);if(t!=s)j.insertBefore(t,k);else{for(;k!=s;)k=l(k);k=k.nextSibling}t.lineObj=b}++n});k;)k=l(k)}function $(a,b,d,e,f){var k,g=ie(a,b),h=g.pre,i=b.gutterMarkers,j=a.display,l=g.bgClass?g.bgClass+" "+(b.bgClass||""):b.bgClass;if(!(a.options.lineNumbers||i||l||b.wrapClass||b.widgets))return h;if(f){f.alignable=null;for(var q,m=!0,n=0,o=null,p=f.firstChild;p;p=q)if(q=p.nextSibling,/\bCodeMirror-linewidget\b/.test(p.className)){for(var r=0;r<b.widgets.length;++r){var s=b.widgets[r];if(s.node==p.firstChild){s.above||o||(o=p),_(s,p,f,e),++n;break}}if(r==b.widgets.length){m=!1;break}}else f.removeChild(p);f.insertBefore(h,o),m&&n==b.widgets.length&&(k=f,f.className=b.wrapClass||"")}if(k||(k=zf("div",null,b.wrapClass,"position: relative"),k.appendChild(h)),l&&k.insertBefore(zf("div",null,l+" CodeMirror-linebackground"),k.firstChild),a.options.lineNumbers||i){var t=k.insertBefore(zf("div",null,"CodeMirror-gutter-wrapper","position: absolute; left: "+(a.options.fixedGutter?e.fixedPos:-e.gutterTotalWidth)+"px"),h);if(a.options.fixedGutter&&(k.alignable||(k.alignable=[])).push(t),!a.options.lineNumbers||i&&i["CodeMirror-linenumbers"]||(k.lineNumber=t.appendChild(zf("div",R(a.options,d),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+e.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+j.lineNumInnerWidth+"px"))),i)for(var u=0;u<a.options.gutters.length;++u){var v=a.options.gutters[u],w=i.hasOwnProperty(v)&&i[v];w&&t.appendChild(zf("div",[w],"CodeMirror-gutter-elt","left: "+e.gutterLeft[v]+"px; width: "+e.gutterWidth[v]+"px"))}}if(c&&(k.style.zIndex=2),b.widgets&&k!=f)for(var r=0,x=b.widgets;r<x.length;++r){var s=x[r],y=zf("div",[s.node],"CodeMirror-linewidget");s.handleMouseEvents||(y.ignoreEvents=!0),_(s,y,k,e),s.above?k.insertBefore(y,a.options.lineNumbers&&0!=b.height?t:h):k.appendChild(y),bf(s,"redraw")}return k}function _(a,b,c,d){if(a.noHScroll){(c.alignable||(c.alignable=[])).push(b);var e=d.wrapperWidth;b.style.left=d.fixedPos+"px",a.coverGutter||(e-=d.gutterTotalWidth,b.style.paddingLeft=d.gutterTotalWidth+"px"),b.style.width=e+"px"}a.coverGutter&&(b.style.zIndex=5,b.style.position="relative",a.noHScroll||(b.style.marginLeft=-d.gutterTotalWidth+"px"))}function ab(a){var b=a.display,c=Hc(a.doc.sel.from,a.doc.sel.to);if(c||a.options.showCursorWhenSelecting?bb(a):b.cursor.style.display=b.otherCursor.style.display="none",c?b.selectionDiv.style.display="none":cb(a),a.options.moveInputWithCursor){var d=yb(a,a.doc.sel.head,"div"),e=Df(b.wrapper),f=Df(b.lineDiv);b.inputDiv.style.top=Math.max(0,Math.min(b.wrapper.clientHeight-10,d.top+f.top-e.top))+"px",b.inputDiv.style.left=Math.max(0,Math.min(b.wrapper.clientWidth-10,d.left+f.left-e.left))+"px"}}function bb(a){var b=a.display,c=yb(a,a.doc.sel.head,"div");b.cursor.style.left=c.left+"px",b.cursor.style.top=c.top+"px",b.cursor.style.height=Math.max(0,c.bottom-c.top)*a.options.cursorHeight+"px",b.cursor.style.display="",c.other?(b.otherCursor.style.display="",b.otherCursor.style.left=c.other.left+"px",b.otherCursor.style.top=c.other.top+"px",b.otherCursor.style.height=.85*(c.other.bottom-c.other.top)+"px"):b.otherCursor.style.display="none"}function cb(a){function i(a,b,c,d){0>b&&(b=0),e.appendChild(zf("div",null,"CodeMirror-selected","position: absolute; left: "+a+"px; top: "+b+"px; width: "+(null==c?h-a:c)+"px; height: "+(d-b)+"px"))}function j(b,d,e){function m(c,d){return xb(a,Gc(b,c),"div",f,d)}var k,l,f=ye(c,b),j=f.text.length;return Of(Fe(f),d||0,null==e?j:e,function(a,b,c){var n,o,p,f=m(a,"left");if(a==b)n=f,o=p=f.left;else{if(n=m(b-1,"right"),"rtl"==c){var q=f;f=n,n=q}o=f.left,p=n.right}null==d&&0==a&&(o=g),n.top-f.top>3&&(i(o,f.top,null,f.bottom),o=g,f.bottom<n.top&&i(o,f.bottom,null,n.top)),null==e&&b==j&&(p=h),(!k||f.top<k.top||f.top==k.top&&f.left<k.left)&&(k=f),(!l||n.bottom>l.bottom||n.bottom==l.bottom&&n.right>l.right)&&(l=n),g+1>o&&(o=g),i(o,n.top,p-o,n.bottom)}),{start:k,end:l}}var b=a.display,c=a.doc,d=a.doc.sel,e=document.createDocumentFragment(),f=kb(a.display),g=f.left,h=b.lineSpace.offsetWidth-f.right;if(d.from.line==d.to.line)j(d.from.line,d.from.ch,d.to.ch);else{var k=ye(c,d.from.line),l=ye(c,d.to.line),m=Rd(c,k)==Rd(c,l),n=j(d.from.line,d.from.ch,m?k.text.length:null).end,o=j(d.to.line,m?0:null,d.to.ch).start;m&&(n.top<o.top-2?(i(n.right,n.top,null,n.bottom),i(g,o.top,o.left,o.bottom)):i(n.right,n.top,o.left-n.right,n.bottom)),n.bottom<o.top&&i(g,n.bottom,null,o.top)}Bf(b.selectionDiv,e),b.selectionDiv.style.display=""}function db(a){if(a.state.focused){var b=a.display;clearInterval(b.blinker);var c=!0;b.cursor.style.visibility=b.otherCursor.style.visibility="",a.options.cursorBlinkRate>0&&(b.blinker=setInterval(function(){b.cursor.style.visibility=b.otherCursor.style.visibility=(c=!c)?"":"hidden"},a.options.cursorBlinkRate))}}function eb(a,b){a.doc.mode.startState&&a.doc.frontier<a.display.showingTo&&a.state.highlight.set(b,tf(fb,a))}function fb(a){var b=a.doc;if(b.frontier<b.first&&(b.frontier=b.first),!(b.frontier>=a.display.showingTo)){var f,c=+new Date+a.options.workTime,d=nd(b.mode,hb(a,b.frontier)),e=[];b.iter(b.frontier,Math.min(b.first+b.size,a.display.showingTo+500),function(g){if(b.frontier>=a.display.showingFrom){var h=g.styles;g.styles=ce(a,g,d,!0);for(var i=!h||h.length!=g.styles.length,j=0;!i&&j<h.length;++j)i=h[j]!=g.styles[j];i&&(f&&f.end==b.frontier?f.end++:e.push(f={start:b.frontier,end:b.frontier+1})),g.stateAfter=nd(b.mode,d)}else ee(a,g.text,d),g.stateAfter=0==b.frontier%5?nd(b.mode,d):null;return++b.frontier,+new Date>c?(eb(a,a.options.workDelay),!0):void 0}),e.length&&Ib(a,function(){for(var a=0;a<e.length;++a)Lb(this,e[a].start,e[a].end)})()}}function gb(a,b,c){for(var d,e,f=a.doc,g=c?-1:b-(a.doc.mode.innerMode?1e3:100),h=b;h>g;--h){if(h<=f.first)return f.first;var i=ye(f,h-1);if(i.stateAfter&&(!c||h<=f.frontier))return h;var j=kf(i.text,null,a.options.tabSize);(null==e||d>j)&&(e=h-1,d=j)}return e}function hb(a,b,c){var d=a.doc,e=a.display;if(!d.mode.startState)return!0;var f=gb(a,b,c),g=f>d.first&&ye(d,f-1).stateAfter;return g=g?nd(d.mode,g):od(d.mode),d.iter(f,b,function(c){ee(a,c.text,g);var h=f==b-1||0==f%5||f>=e.showingFrom&&f<e.showingTo;c.stateAfter=h?nd(d.mode,g):null,++f}),c&&(d.frontier=f),g}function ib(a){return a.lineSpace.offsetTop}function jb(a){return a.mover.offsetHeight-a.lineSpace.offsetHeight}function kb(a){if(a.cachedPaddingH)return a.cachedPaddingH;var b=Bf(a.measure,zf("pre","x")),c=window.getComputedStyle?window.getComputedStyle(b):b.currentStyle;return a.cachedPaddingH={left:parseInt(c.paddingLeft),right:parseInt(c.paddingRight)}}function lb(a,b,c,d,e){var f=-1;if(d=d||ob(a,b),d.crude){var g=d.left+c*d.width;return{left:g,right:g+d.width,top:d.top,bottom:d.bottom}}for(var h=c;;h+=f){var i=d[h];if(i)break;0>f&&0==h&&(f=1)}return e=h>c?"left":c>h?"right":e,"left"==e&&i.leftSide?i=i.leftSide:"right"==e&&i.rightSide&&(i=i.rightSide),{left:c>h?i.right:i.left,right:h>c?i.left:i.right,top:i.top,bottom:i.bottom}}function mb(a,b){for(var c=a.display.measureLineCache,d=0;d<c.length;++d){var e=c[d];if(e.text==b.text&&e.markedSpans==b.markedSpans&&a.display.scroller.clientWidth==e.width&&e.classes==b.textClass+"|"+b.wrapClass)return e}}function nb(a,b){var c=mb(a,b);c&&(c.text=c.measure=c.markedSpans=null)}function ob(a,b){var c=mb(a,b);if(c)return c.measure;var d=pb(a,b),e=a.display.measureLineCache,f={text:b.text,width:a.display.scroller.clientWidth,markedSpans:b.markedSpans,measure:d,classes:b.textClass+"|"+b.wrapClass};return 16==e.length?e[++a.display.measureLineCachePos%16]=f:e.push(f),d}function pb(a,e){function t(a){var b=a.top-p.top,c=a.bottom-p.top;c>s&&(c=s),0>b&&(b=0);for(var d=q.length-2;d>=0;d-=2){var e=q[d],f=q[d+1];if(!(e>c||b>f)&&(b>=e&&f>=c||e>=b&&c>=f||Math.min(c,f)-Math.max(b,e)>=c-b>>1)){q[d]=Math.min(b,e),q[d+1]=Math.max(c,f);break}}return 0>d&&(d=q.length,q.push(b,c)),{left:a.left-p.left,right:a.right-p.left,top:d,bottom:null}}function u(a){a.bottom=q[a.top+1],a.top=q[a.top]}if(!a.options.lineWrapping&&e.text.length>=a.options.crudeMeasuringFrom)return qb(a,e);var f=a.display,g=sf(e.text.length),h=ie(a,e,g,!0).pre;if(b&&!c&&!a.options.lineWrapping&&h.childNodes.length>100){for(var i=document.createDocumentFragment(),j=10,k=h.childNodes.length,l=0,m=Math.ceil(k/j);m>l;++l){for(var n=zf("div",null,null,"display: inline-block"),o=0;j>o&&k;++o)n.appendChild(h.firstChild),--k;i.appendChild(n)}h.appendChild(i)}Bf(f.measure,h);var p=Df(f.lineDiv),q=[],r=sf(e.text.length),s=h.offsetHeight;d&&f.measure.first!=h&&Bf(f.measure,h);for(var v,l=0;l<g.length;++l)if(v=g[l]){var w=v,x=null;if(/\bCodeMirror-widget\b/.test(v.className)&&v.getClientRects){1==v.firstChild.nodeType&&(w=v.firstChild);var y=w.getClientRects();y.length>1&&(x=r[l]=t(y[0]),x.rightSide=t(y[y.length-1]))}x||(x=r[l]=t(Df(w))),v.measureRight&&(x.right=Df(v.measureRight).left-p.left),v.leftSide&&(x.leftSide=t(Df(v.leftSide)))}Af(a.display.measure);for(var v,l=0;l<r.length;++l)(v=r[l])&&(u(v),v.leftSide&&u(v.leftSide),v.rightSide&&u(v.rightSide));return r}function qb(a,b){var c=new $d(b.text.slice(0,100),null);b.textClass&&(c.textClass=b.textClass);var d=pb(a,c),e=lb(a,c,0,d,"left"),f=lb(a,c,99,d,"right");return{crude:!0,top:e.top,left:e.left,bottom:e.bottom,width:(f.right-e.left)/100}}function rb(a,b){var c=!1;if(b.markedSpans)for(var d=0;d<b.markedSpans;++d){var e=b.markedSpans[d];!e.collapsed||null!=e.to&&e.to!=b.text.length||(c=!0)}var f=!c&&mb(a,b);if(f||b.text.length>=a.options.crudeMeasuringFrom)return lb(a,b,b.text.length,f&&f.measure,"right").right;var g=ie(a,b,null,!0).pre,h=g.appendChild(Jf(a.display.measure));Bf(a.display.measure,g);var i=Df(h);return 0==i.right&&0==i.bottom&&(h=g.appendChild(zf("span","\xa0")),i=Df(h)),i.left-Df(a.display.lineDiv).left}function sb(a){a.display.measureLineCache.length=a.display.measureLineCachePos=0,a.display.cachedCharWidth=a.display.cachedTextHeight=a.display.cachedPaddingH=null,a.options.lineWrapping||(a.display.maxLineChanged=!0),a.display.lineNumChars=null}function tb(){return window.pageXOffset||(document.documentElement||document.body).scrollLeft}function ub(){return window.pageYOffset||(document.documentElement||document.body).scrollTop}function vb(a,b,c,d){if(b.widgets)for(var e=0;e<b.widgets.length;++e)if(b.widgets[e].above){var f=Yd(b.widgets[e]);c.top+=f,c.bottom+=f}if("line"==d)return c;d||(d="local");var g=Ee(a,b);if("local"==d?g+=ib(a.display):g-=a.display.viewOffset,"page"==d||"window"==d){var h=Df(a.display.lineSpace);g+=h.top+("window"==d?0:ub());var i=h.left+("window"==d?0:tb());c.left+=i,c.right+=i}return c.top+=g,c.bottom+=g,c}function wb(a,b,c){if("div"==c)return b;var d=b.left,e=b.top;if("page"==c)d-=tb(),e-=ub();else if("local"==c||!c){var f=Df(a.display.sizer);d+=f.left,e+=f.top}var g=Df(a.display.lineSpace);return{left:d-g.left,top:e-g.top}}function xb(a,b,c,d,e){return d||(d=ye(a.doc,b.line)),vb(a,d,lb(a,d,b.ch,null,e),c)}function yb(a,b,c,d,e){function f(b,f){var g=lb(a,d,b,e,f?"right":"left");return f?g.left=g.right:g.right=g.left,vb(a,d,g,c)}function g(a,b){var c=h[b],d=c.level%2;return a==Pf(c)&&b&&c.level<h[b-1].level?(c=h[--b],a=Qf(c)-(c.level%2?0:1),d=!0):a==Qf(c)&&b<h.length-1&&c.level<h[b+1].level&&(c=h[++b],a=Pf(c)-c.level%2,d=!1),d&&a==c.to&&a>c.from?f(a-1):f(a,d)}d=d||ye(a.doc,b.line),e||(e=ob(a,d));var h=Fe(d),i=b.ch;if(!h)return f(i);var j=Xf(h,i),k=g(i,j);return null!=Wf&&(k.other=g(i,Wf)),k}function zb(a,b,c,d){var e=new Gc(a,b);return e.xRel=d,c&&(e.outside=!0),e}function Ab(a,b,c){var d=a.doc;if(c+=a.display.viewOffset,0>c)return zb(d.first,0,!0,-1);var e=De(d,c),f=d.first+d.size-1;if(e>f)return zb(d.first+d.size-1,ye(d,f).text.length,!0,1);for(0>b&&(b=0);;){var g=ye(d,e),h=Bb(a,g,e,b,c),i=Pd(g),j=i&&i.find();if(!i||!(h.ch>j.from.ch||h.ch==j.from.ch&&h.xRel>0))return h;e=j.to.line}}function Bb(a,b,c,d,e){function j(d){var e=yb(a,Gc(c,d),"line",b,i);return g=!0,f>e.bottom?e.left-h:f<e.top?e.left+h:(g=!1,e.left)}var f=e-Ee(a,b),g=!1,h=2*a.display.wrapper.clientWidth,i=ob(a,b),k=Fe(b),l=b.text.length,m=Rf(b),n=Sf(b),o=j(m),p=g,q=j(n),r=g;if(d>q)return zb(c,n,r,1);for(;;){if(k?n==m||n==Zf(b,m,1):1>=n-m){for(var s=o>d||q-d>=d-o?m:n,t=d-(s==m?o:q);yf(b.text.charAt(s));)++s;var u=zb(c,s,s==m?p:r,0>t?-1:t?1:0);return u}var v=Math.ceil(l/2),w=m+v;if(k){w=m;for(var x=0;v>x;++x)w=Zf(b,w,1)}var y=j(w);y>d?(n=w,q=y,(r=g)&&(q+=1e3),l=v):(m=w,o=y,p=g,l-=v)}}function Db(a){if(null!=a.cachedTextHeight)return a.cachedTextHeight;if(null==Cb){Cb=zf("pre");for(var b=0;49>b;++b)Cb.appendChild(document.createTextNode("x")),Cb.appendChild(zf("br"));Cb.appendChild(document.createTextNode("x"))}Bf(a.measure,Cb);var c=Cb.offsetHeight/50;return c>3&&(a.cachedTextHeight=c),Af(a.measure),c||1}function Eb(a){if(null!=a.cachedCharWidth)return a.cachedCharWidth;var b=zf("span","x"),c=zf("pre",[b]);Bf(a.measure,c);var d=b.offsetWidth;return d>2&&(a.cachedCharWidth=d),d||10}function Gb(a){a.curOp={changes:[],forceUpdate:!1,updateInput:null,userSelChange:null,textChanged:null,selectionChanged:!1,cursorActivity:!1,updateMaxLine:!1,updateScrollPos:!1,id:++Fb},af++||(_e=[])}function Hb(a){var b=a.curOp,c=a.doc,d=a.display;if(a.curOp=null,b.updateMaxLine&&L(a),d.maxLineChanged&&!a.options.lineWrapping&&d.maxLine){var e=rb(a,d.maxLine);d.sizer.style.minWidth=Math.max(0,e+3)+"px",d.maxLineChanged=!1;var f=Math.max(0,d.sizer.offsetLeft+d.sizer.offsetWidth-d.scroller.clientWidth);f<c.scrollLeft&&!b.updateScrollPos&&ec(a,Math.min(d.scroller.scrollLeft,f),!0)}var g,h;if(b.updateScrollPos)g=b.updateScrollPos;else if(b.selectionChanged&&d.scroller.clientHeight){var i=yb(a,c.sel.head);g=Xc(a,i.left,i.top,i.left,i.bottom)}if((b.changes.length||b.forceUpdate||g&&null!=g.scrollTop)&&(h=T(a,b.changes,g&&g.scrollTop,b.forceUpdate),a.display.scroller.offsetHeight&&(a.doc.scrollTop=a.display.scroller.scrollTop)),!h&&b.selectionChanged&&ab(a),b.updateScrollPos){var j=Math.max(0,Math.min(d.scroller.scrollHeight-d.scroller.clientHeight,g.scrollTop)),k=Math.max(0,Math.min(d.scroller.scrollWidth-d.scroller.clientWidth,g.scrollLeft));d.scroller.scrollTop=d.scrollbarV.scrollTop=c.scrollTop=j,d.scroller.scrollLeft=d.scrollbarH.scrollLeft=c.scrollLeft=k,P(a),b.scrollToPos&&Vc(a,Mc(a.doc,b.scrollToPos.from),Mc(a.doc,b.scrollToPos.to),b.scrollToPos.margin)}else g&&Uc(a);b.selectionChanged&&db(a),a.state.focused&&b.updateInput&&Pb(a,b.userSelChange);var l=b.maybeHiddenMarkers,m=b.maybeUnhiddenMarkers;if(l)for(var n=0;n<l.length;++n)l[n].lines.length||$e(l[n],"hide");if(m)for(var n=0;n<m.length;++n)m[n].lines.length&&$e(m[n],"unhide");var o;if(--af||(o=_e,_e=null),b.textChanged&&$e(a,"change",a,b.textChanged),b.cursorActivity&&$e(a,"cursorActivity",a),o)for(var n=0;n<o.length;++n)o[n]()}function Ib(a,b){return function(){var c=a||this,d=!c.curOp;d&&Gb(c);try{var e=b.apply(c,arguments)}finally{d&&Hb(c)}return e}}function Jb(a){return function(){var c,b=this.cm&&!this.cm.curOp;b&&Gb(this.cm);try{c=a.apply(this,arguments)}finally{b&&Hb(this.cm)}return c}}function Kb(a,b){var d,c=!a.curOp;c&&Gb(a);try{d=b()}finally{c&&Hb(a)}return d}function Lb(a,b,c,d){null==b&&(b=a.doc.first),null==c&&(c=a.doc.first+a.doc.size),a.curOp.changes.push({from:b,to:c,diff:d})}function Mb(a){a.display.pollingFast||a.display.poll.set(a.options.pollInterval,function(){Ob(a),a.state.focused&&Mb(a)})}function Nb(a){function c(){var d=Ob(a);d||b?(a.display.pollingFast=!1,Mb(a)):(b=!0,a.display.poll.set(60,c))}var b=!1;a.display.pollingFast=!0,a.display.poll.set(20,c)}function Ob(a){var b=a.display.input,c=a.display.prevInput,e=a.doc,f=e.sel;if(!a.state.focused||Lf(b)||Sb(a)||a.options.disableInput)return!1;a.state.pasteIncoming&&a.state.fakedLastChar&&(b.value=b.value.substring(0,b.value.length-1),a.state.fakedLastChar=!1);var h=b.value;if(h==c&&Hc(f.from,f.to))return!1;if(g&&!d&&a.display.inputHasSelection===h)return Pb(a,!0),!1;var i=!a.curOp;i&&Gb(a),f.shift=!1;for(var j=0,k=Math.min(c.length,h.length);k>j&&c.charCodeAt(j)==h.charCodeAt(j);)++j;var l=f.from,m=f.to,n=h.slice(j);j<c.length?l=Gc(l.line,l.ch-(c.length-j)):a.state.overwrite&&Hc(l,m)&&!a.state.pasteIncoming&&(m=Gc(m.line,Math.min(ye(e,m.line).text.length,m.ch+n.length)));var o=a.curOp.updateInput,p={from:l,to:m,text:Kf(n),origin:a.state.pasteIncoming?"paste":a.state.cutIncoming?"cut":"+input"};if(zc(a.doc,p,"end"),a.curOp.updateInput=o,bf(a,"inputRead",a,p),n&&!a.state.pasteIncoming&&a.options.electricChars&&a.options.smartIndent&&f.head.ch<100){var q=a.getModeAt(f.head).electricChars;if(q)for(var r=0;r<q.length;r++)if(n.indexOf(q.charAt(r))>-1){$c(a,f.head.line,"smart");break}}return h.length>1e3||h.indexOf("\n")>-1?b.value=a.display.prevInput="":a.display.prevInput=h,i&&Hb(a),a.state.pasteIncoming=a.state.cutIncoming=!1,!0}function Pb(a,b){var c,e,f=a.doc;if(Hc(f.sel.from,f.sel.to))b&&(a.display.prevInput=a.display.input.value="",g&&!d&&(a.display.inputHasSelection=null));else{a.display.prevInput="",c=Mf&&(f.sel.to.line-f.sel.from.line>100||(e=a.getSelection()).length>1e3);var h=c?"-":e||a.getSelection();a.display.input.value=h,a.state.focused&&of(a.display.input),g&&!d&&(a.display.inputHasSelection=h)}a.display.inaccurateSelection=c}function Qb(a){"nocursor"==a.options.readOnly||r&&document.activeElement==a.display.input||a.display.input.focus()}function Rb(a){a.state.focused||(Qb(a),rc(a))}function Sb(a){return a.options.readOnly||a.doc.cantEdit}function Tb(a){function e(){a.state.focused&&setTimeout(tf(Qb,a),0)}function i(){null==f&&(f=setTimeout(function(){f=null,c.cachedCharWidth=c.cachedTextHeight=c.cachedPaddingH=Gf=null,sb(a),Kb(a,tf(Lb,a))},100))}function j(){for(var a=c.wrapper.parentNode;a&&a!=document.body;a=a.parentNode);a?setTimeout(j,5e3):Ze(window,"resize",i)}function k(b){cf(a,b)||a.options.onDragEvent&&a.options.onDragEvent(a,Re(b))||Ve(b)}function l(b){c.inaccurateSelection&&(c.prevInput="",c.inaccurateSelection=!1,c.input.value=a.getSelection(),of(c.input)),"cut"==b.type&&(a.state.cutIncoming=!0)}var c=a.display;Ye(c.scroller,"mousedown",Ib(a,Yb)),b?Ye(c.scroller,"dblclick",Ib(a,function(b){if(!cf(a,b)){var c=Vb(a,b);if(c&&!_b(a,b)&&!Ub(a.display,b)){Se(b);var d=cd(ye(a.doc,c.line).text,c);Pc(a.doc,d.from,d.to)}}})):Ye(c.scroller,"dblclick",function(b){cf(a,b)||Se(b)}),Ye(c.lineSpace,"selectstart",function(a){Ub(c,a)||Se(a)}),w||Ye(c.scroller,"contextmenu",function(b){uc(a,b)}),Ye(c.scroller,"scroll",function(){c.scroller.clientHeight&&(dc(a,c.scroller.scrollTop),ec(a,c.scroller.scrollLeft,!0),$e(a,"scroll",a))}),Ye(c.scrollbarV,"scroll",function(){c.scroller.clientHeight&&dc(a,c.scrollbarV.scrollTop)}),Ye(c.scrollbarH,"scroll",function(){c.scroller.clientHeight&&ec(a,c.scrollbarH.scrollLeft)}),Ye(c.scroller,"mousewheel",function(b){hc(a,b)}),Ye(c.scroller,"DOMMouseScroll",function(b){hc(a,b)}),Ye(c.scrollbarH,"mousedown",e),Ye(c.scrollbarV,"mousedown",e),Ye(c.wrapper,"scroll",function(){c.wrapper.scrollTop=c.wrapper.scrollLeft=0});var f;Ye(window,"resize",i),setTimeout(j,5e3),Ye(c.input,"keyup",Ib(a,nc)),Ye(c.input,"input",function(){g&&!d&&a.display.inputHasSelection&&(a.display.inputHasSelection=null),Nb(a)}),Ye(c.input,"keydown",Ib(a,pc)),Ye(c.input,"keypress",Ib(a,qc)),Ye(c.input,"focus",tf(rc,a)),Ye(c.input,"blur",tf(sc,a)),a.options.dragDrop&&(Ye(c.scroller,"dragstart",function(b){cc(a,b)}),Ye(c.scroller,"dragenter",k),Ye(c.scroller,"dragover",k),Ye(c.scroller,"drop",Ib(a,bc))),Ye(c.scroller,"paste",function(b){Ub(c,b)||(Qb(a),Nb(a))}),Ye(c.input,"paste",function(){if(h&&!a.state.fakedLastChar&&!(new Date-a.state.lastMiddleDown<200)){var b=c.input.selectionStart,d=c.input.selectionEnd;
-c.input.value+="$",c.input.selectionStart=b,c.input.selectionEnd=d,a.state.fakedLastChar=!0}a.state.pasteIncoming=!0,Nb(a)}),Ye(c.input,"cut",l),Ye(c.input,"copy",l),m&&Ye(c.sizer,"mouseup",function(){document.activeElement==c.input&&c.input.blur(),Qb(a)})}function Ub(a,b){for(var c=We(b);c!=a.wrapper;c=c.parentNode)if(!c||c.ignoreEvents||c.parentNode==a.sizer&&c!=a.mover)return!0}function Vb(a,b,c){var d=a.display;if(!c){var e=We(b);if(e==d.scrollbarH||e==d.scrollbarH.firstChild||e==d.scrollbarV||e==d.scrollbarV.firstChild||e==d.scrollbarFiller||e==d.gutterFiller)return null}var f,g,h=Df(d.lineSpace);try{f=b.clientX,g=b.clientY}catch(b){return null}return Ab(a,f-h.left,g-h.top)}function Yb(a){function t(a){if(!Hc(s,a)){if(s=a,"single"==m)return Pc(c.doc,Mc(i,k),a),void 0;if(q=Mc(i,q),r=Mc(i,r),"double"==m){var b=cd(ye(i,a.line).text,a);Ic(a,q)?Pc(c.doc,b.from,r):Pc(c.doc,q,b.to)}else"triple"==m&&(Ic(a,q)?Pc(c.doc,r,Mc(i,Gc(a.line,0))):Pc(c.doc,q,Mc(i,Gc(a.line+1,0))))}}function x(a){var b=++v,d=Vb(c,a,!0);if(d)if(Hc(d,o)){var g=a.clientY<u.top?-20:a.clientY>u.bottom?20:0;g&&setTimeout(Ib(c,function(){v==b&&(f.scroller.scrollTop+=g,x(a))}),50)}else{Rb(c),o=d,t(d);var e=O(f,i);(d.line>=e.to||d.line<e.from)&&setTimeout(Ib(c,function(){v==b&&x(a)}),150)}}function y(a){v=1/0,Se(a),Qb(c),Ze(document,"mousemove",z),Ze(document,"mouseup",A)}if(!cf(this,a)){var c=this,f=c.display,i=c.doc,j=i.sel;if(j.shift=a.shiftKey,Ub(f,a))return h||(f.scroller.draggable=!1,setTimeout(function(){f.scroller.draggable=!0},100)),void 0;if(!_b(c,a)){var k=Vb(c,a);switch(window.focus(),Xe(a)){case 3:return w&&uc.call(c,c,a),void 0;case 2:return h&&(c.state.lastMiddleDown=+new Date),k&&Pc(c.doc,k),setTimeout(tf(Qb,c),20),Se(a),void 0}if(!k)return We(a)==f.scroller&&Se(a),void 0;setTimeout(tf(Rb,c),0);var l=+new Date,m="single";if(Xb&&Xb.time>l-400&&Hc(Xb.pos,k))m="triple",Se(a),setTimeout(tf(Qb,c),20),dd(c,k.line);else if(Wb&&Wb.time>l-400&&Hc(Wb.pos,k)){m="double",Xb={time:l,pos:k},Se(a);var n=cd(ye(i,k.line).text,k);Pc(c.doc,n.from,n.to)}else Wb={time:l,pos:k};var o=k;if(c.options.dragDrop&&Ef&&!Sb(c)&&!Hc(j.from,j.to)&&!Ic(k,j.from)&&!Ic(j.to,k)&&"single"==m){var p=Ib(c,function(e){h&&(f.scroller.draggable=!1),c.state.draggingText=!1,Ze(document,"mouseup",p),Ze(f.scroller,"drop",p),Math.abs(a.clientX-e.clientX)+Math.abs(a.clientY-e.clientY)<10&&(Se(e),Pc(c.doc,k),Qb(c),b&&!d&&setTimeout(function(){document.body.focus(),Qb(c)},20))});return h&&(f.scroller.draggable=!0),c.state.draggingText=p,f.scroller.dragDrop&&f.scroller.dragDrop(),Ye(document,"mouseup",p),Ye(f.scroller,"drop",p),void 0}Se(a),"single"==m&&Pc(c.doc,Mc(i,k));var q=j.from,r=j.to,s=k,u=Df(f.wrapper),v=0,z=Ib(c,function(a){(g&&!e?a.buttons:Xe(a))?x(a):y(a)}),A=Ib(c,y);Ye(document,"mousemove",z),Ye(document,"mouseup",A)}}}function Zb(a,b,c,d,e){try{var f=b.clientX,g=b.clientY}catch(b){return!1}if(f>=Math.floor(Df(a.display.gutters).right))return!1;d&&Se(b);var h=a.display,i=Df(h.lineDiv);if(g>i.bottom||!ef(a,c))return Ue(b);g-=i.top-h.viewOffset;for(var j=0;j<a.options.gutters.length;++j){var k=h.gutters.childNodes[j];if(k&&Df(k).right>=f){var l=De(a.doc,g),m=a.options.gutters[j];return e(a,c,a,l,m,b),Ue(b)}}}function $b(a,b){return ef(a,"gutterContextMenu")?Zb(a,b,"gutterContextMenu",!1,$e):!1}function _b(a,b){return Zb(a,b,"gutterClick",!0,bf)}function bc(a){var b=this;if(!(cf(b,a)||Ub(b.display,a)||b.options.onDragEvent&&b.options.onDragEvent(b,Re(a)))){Se(a),g&&(ac=+new Date);var c=Vb(b,a,!0),d=a.dataTransfer.files;if(c&&!Sb(b))if(d&&d.length&&window.FileReader&&window.File)for(var e=d.length,f=Array(e),h=0,i=function(a,d){var g=new FileReader;g.onload=function(){f[d]=g.result,++h==e&&(c=Mc(b.doc,c),zc(b.doc,{from:c,to:c,text:Kf(f.join("\n")),origin:"paste"},"around"))},g.readAsText(a)},j=0;e>j;++j)i(d[j],j);else{if(b.state.draggingText&&!Ic(c,b.doc.sel.from)&&!Ic(b.doc.sel.to,c))return b.state.draggingText(a),setTimeout(tf(Qb,b),20),void 0;try{var f=a.dataTransfer.getData("Text");if(f){var k=b.doc.sel.from,l=b.doc.sel.to;Rc(b.doc,c,c),b.state.draggingText&&Fc(b.doc,"",k,l,"paste"),b.replaceSelection(f,null,"paste"),Qb(b)}}catch(a){}}}}function cc(a,b){if(g&&(!a.state.draggingText||+new Date-ac<100))return Ve(b),void 0;if(!cf(a,b)&&!Ub(a.display,b)){var c=a.getSelection();if(b.dataTransfer.setData("Text",c),b.dataTransfer.setDragImage&&!l){var d=zf("img",null,null,"position: fixed; left: 0; top: 0;");d.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",k&&(d.width=d.height=1,a.display.wrapper.appendChild(d),d._top=d.offsetTop),b.dataTransfer.setDragImage(d,0,0),k&&d.parentNode.removeChild(d)}}}function dc(b,c){Math.abs(b.doc.scrollTop-c)<2||(b.doc.scrollTop=c,a||T(b,[],c),b.display.scroller.scrollTop!=c&&(b.display.scroller.scrollTop=c),b.display.scrollbarV.scrollTop!=c&&(b.display.scrollbarV.scrollTop=c),a&&T(b,[]),eb(b,100))}function ec(a,b,c){(c?b==a.doc.scrollLeft:Math.abs(a.doc.scrollLeft-b)<2)||(b=Math.min(b,a.display.scroller.scrollWidth-a.display.scroller.clientWidth),a.doc.scrollLeft=b,P(a),a.display.scroller.scrollLeft!=b&&(a.display.scroller.scrollLeft=b),a.display.scrollbarH.scrollLeft!=b&&(a.display.scrollbarH.scrollLeft=b))}function hc(b,c){var d=c.wheelDeltaX,e=c.wheelDeltaY;null==d&&c.detail&&c.axis==c.HORIZONTAL_AXIS&&(d=c.detail),null==e&&c.detail&&c.axis==c.VERTICAL_AXIS?e=c.detail:null==e&&(e=c.wheelDelta);var f=b.display,g=f.scroller;if(d&&g.scrollWidth>g.clientWidth||e&&g.scrollHeight>g.clientHeight){if(e&&s&&h)for(var i=c.target;i!=g;i=i.parentNode)if(i.lineObj){b.display.currentWheelTarget=i;break}if(d&&!a&&!k&&null!=gc)return e&&dc(b,Math.max(0,Math.min(g.scrollTop+e*gc,g.scrollHeight-g.clientHeight))),ec(b,Math.max(0,Math.min(g.scrollLeft+d*gc,g.scrollWidth-g.clientWidth))),Se(c),f.wheelStartX=null,void 0;if(e&&null!=gc){var j=e*gc,l=b.doc.scrollTop,m=l+f.wrapper.clientHeight;0>j?l=Math.max(0,l+j-50):m=Math.min(b.doc.height,m+j+50),T(b,[],{top:l,bottom:m})}20>fc&&(null==f.wheelStartX?(f.wheelStartX=g.scrollLeft,f.wheelStartY=g.scrollTop,f.wheelDX=d,f.wheelDY=e,setTimeout(function(){if(null!=f.wheelStartX){var a=g.scrollLeft-f.wheelStartX,b=g.scrollTop-f.wheelStartY,c=b&&f.wheelDY&&b/f.wheelDY||a&&f.wheelDX&&a/f.wheelDX;f.wheelStartX=f.wheelStartY=null,c&&(gc=(gc*fc+c)/(fc+1),++fc)}},200)):(f.wheelDX+=d,f.wheelDY+=e))}}function ic(a,b,c){if("string"==typeof b&&(b=pd[b],!b))return!1;a.display.pollingFast&&Ob(a)&&(a.display.pollingFast=!1);var d=a.doc,e=d.sel.shift,f=!1;try{Sb(a)&&(a.state.suppressEdits=!0),c&&(d.sel.shift=!1),f=b(a)!=hf}finally{d.sel.shift=e,a.state.suppressEdits=!1}return f}function jc(a){var b=a.state.keyMaps.slice(0);return a.options.extraKeys&&b.push(a.options.extraKeys),b.push(a.options.keyMap),b}function lc(a,b){var c=rd(a.options.keyMap),e=c.auto;clearTimeout(kc),e&&!td(b)&&(kc=setTimeout(function(){rd(a.options.keyMap)==c&&(a.options.keyMap=e.call?e.call(null,a):e,G(a))},50));var f=ud(b,!0),g=!1;if(!f)return!1;var h=jc(a);return g=b.shiftKey?sd("Shift-"+f,h,function(b){return ic(a,b,!0)})||sd(f,h,function(b){return("string"==typeof b?/^go[A-Z]/.test(b):b.motion)?ic(a,b):void 0}):sd(f,h,function(b){return ic(a,b)}),g&&(Se(b),db(a),d&&(b.oldKeyCode=b.keyCode,b.keyCode=0),bf(a,"keyHandled",a,f,b)),g}function mc(a,b,c){var d=sd("'"+c+"'",jc(a),function(b){return ic(a,b,!0)});return d&&(Se(b),db(a),bf(a,"keyHandled",a,"'"+c+"'",b)),d}function nc(a){var b=this;cf(b,a)||b.options.onKeyEvent&&b.options.onKeyEvent(b,Re(a))||16==a.keyCode&&(b.doc.sel.shift=!1)}function pc(a){var c=this;if(Rb(c),!(cf(c,a)||c.options.onKeyEvent&&c.options.onKeyEvent(c,Re(a)))){b&&27==a.keyCode&&(a.returnValue=!1);var d=a.keyCode;c.doc.sel.shift=16==d||a.shiftKey;var e=lc(c,a);k&&(oc=e?d:null,!e&&88==d&&!Mf&&(s?a.metaKey:a.ctrlKey)&&c.replaceSelection(""))}}function qc(a){var b=this;if(!(cf(b,a)||b.options.onKeyEvent&&b.options.onKeyEvent(b,Re(a)))){var c=a.keyCode,e=a.charCode;if(k&&c==oc)return oc=null,Se(a),void 0;if(!(k&&(!a.which||a.which<10)||m)||!lc(b,a)){var f=String.fromCharCode(null==e?c:e);mc(b,a,f)||(g&&!d&&(b.display.inputHasSelection=null),Nb(b))}}}function rc(a){"nocursor"!=a.options.readOnly&&(a.state.focused||($e(a,"focus",a),a.state.focused=!0,-1==a.display.wrapper.className.search(/\bCodeMirror-focused\b/)&&(a.display.wrapper.className+=" CodeMirror-focused"),a.curOp||(Pb(a,!0),h&&setTimeout(tf(Pb,a,!0),0))),Mb(a),db(a))}function sc(a){a.state.focused&&($e(a,"blur",a),a.state.focused=!1,a.display.wrapper.className=a.display.wrapper.className.replace(" CodeMirror-focused","")),clearInterval(a.display.blinker),setTimeout(function(){a.state.focused||(a.doc.sel.shift=!1)},150)}function uc(a,b){function l(){if(null!=c.input.selectionStart){var a=c.input.value="\u200b"+(Hc(e.from,e.to)?"":c.input.value);c.prevInput="\u200b",c.input.selectionStart=1,c.input.selectionEnd=a.length}}function m(){if(c.inputDiv.style.position="relative",c.input.style.cssText=j,d&&(c.scrollbarV.scrollTop=c.scroller.scrollTop=h),Mb(a),null!=c.input.selectionStart){(!g||d)&&l(),clearTimeout(tc);var b=0,e=function(){"\u200b"==c.prevInput&&0==c.input.selectionStart?Ib(a,pd.selectAll)(a):b++<10?tc=setTimeout(e,500):Pb(a)};tc=setTimeout(e,200)}}if(!cf(a,b,"contextmenu")){var c=a.display,e=a.doc.sel;if(!Ub(c,b)&&!$b(a,b)){var f=Vb(a,b),h=c.scroller.scrollTop;if(f&&!k){var i=a.options.resetSelectionOnContextMenu;i&&(Hc(e.from,e.to)||Ic(f,e.from)||!Ic(f,e.to))&&Ib(a,Rc)(a.doc,f,f);var j=c.input.style.cssText;if(c.inputDiv.style.position="absolute",c.input.style.cssText="position: fixed; width: 30px; height: 30px; top: "+(b.clientY-5)+"px; left: "+(b.clientX-5)+"px; z-index: 1000; background: transparent; outline: none;"+"border-width: 0; outline: none; overflow: hidden; opacity: .05; -ms-opacity: .05; filter: alpha(opacity=5);",Qb(a),Pb(a,!0),Hc(e.from,e.to)&&(c.input.value=c.prevInput=" "),g&&!d&&l(),w){Ve(b);var n=function(){Ze(window,"mouseup",n),setTimeout(m,20)};Ye(window,"mouseup",n)}else setTimeout(m,50)}}}}function wc(a,b,c){if(!Ic(b.from,c))return Mc(a,c);var d=b.text.length-1-(b.to.line-b.from.line);if(c.line>b.to.line+d){var e=c.line-d,f=a.first+a.size-1;return e>f?Gc(f,ye(a,f).text.length):Nc(c,ye(a,e).text.length)}if(c.line==b.to.line+d)return Nc(c,nf(b.text).length+(1==b.text.length?b.from.ch:0)+ye(a,b.to.line).text.length-b.to.ch);var g=c.line-b.from.line;return Nc(c,b.text[g].length+(g?0:b.from.ch))}function xc(a,b,c){if(c&&"object"==typeof c)return{anchor:wc(a,b,c.anchor),head:wc(a,b,c.head)};if("start"==c)return{anchor:b.from,head:b.from};var d=vc(b);if("around"==c)return{anchor:b.from,head:d};if("end"==c)return{anchor:d,head:d};var e=function(a){if(Ic(a,b.from))return a;if(!Ic(b.to,a))return d;var c=a.line+b.text.length-(b.to.line-b.from.line)-1,e=a.ch;return a.line==b.to.line&&(e+=d.ch-b.to.ch),Gc(c,e)};return{anchor:e(a.sel.anchor),head:e(a.sel.head)}}function yc(a,b,c){var d={canceled:!1,from:b.from,to:b.to,text:b.text,origin:b.origin,cancel:function(){this.canceled=!0}};return c&&(d.update=function(b,c,d,e){b&&(this.from=Mc(a,b)),c&&(this.to=Mc(a,c)),d&&(this.text=d),void 0!==e&&(this.origin=e)}),$e(a,"beforeChange",a,d),a.cm&&$e(a.cm,"beforeChange",a.cm,d),d.canceled?null:{from:d.from,to:d.to,text:d.text,origin:d.origin}}function zc(a,b,c,d){if(a.cm){if(!a.cm.curOp)return Ib(a.cm,zc)(a,b,c,d);if(a.cm.state.suppressEdits)return}if(!(ef(a,"beforeChange")||a.cm&&ef(a.cm,"beforeChange"))||(b=yc(a,b,!0))){var e=x&&!d&&Jd(a,b.from,b.to);if(e){for(var f=e.length-1;f>=1;--f)Ac(a,{from:e[f].from,to:e[f].to,text:[""]});e.length&&Ac(a,{from:e[0].from,to:e[0].to,text:b.text},c)}else Ac(a,b,c)}}function Ac(a,b,c){if(1!=b.text.length||""!=b.text[0]||!Hc(b.from,b.to)){var d=xc(a,b,c);Je(a,b,d,a.cm?a.cm.curOp.id:0/0),Dc(a,b,d,Gd(a,b));var e=[];we(a,function(a,c){c||-1!=pf(e,a.history)||(Pe(a.history,b),e.push(a.history)),Dc(a,b,null,Gd(a,b))})}}function Bc(a,b){if(!a.cm||!a.cm.state.suppressEdits){var c=a.history,d=("undo"==b?c.done:c.undone).pop();if(d){var e={changes:[],anchorBefore:d.anchorAfter,headBefore:d.headAfter,anchorAfter:d.anchorBefore,headAfter:d.headBefore,generation:c.generation};("undo"==b?c.undone:c.done).push(e),c.generation=d.generation||++c.maxGeneration;for(var f=ef(a,"beforeChange")||a.cm&&ef(a.cm,"beforeChange"),g=d.changes.length-1;g>=0;--g){var h=d.changes[g];if(h.origin=b,f&&!yc(a,h,!1))return("undo"==b?c.done:c.undone).length=0,void 0;e.changes.push(Ie(a,h));var i=g?xc(a,h,null):{anchor:d.anchorBefore,head:d.headBefore};Dc(a,h,i,Id(a,h));var j=[];we(a,function(a,b){b||-1!=pf(j,a.history)||(Pe(a.history,h),j.push(a.history)),Dc(a,h,null,Id(a,h))})}}}}function Cc(a,b){function c(a){return Gc(a.line+b,a.ch)}a.first+=b,a.cm&&Lb(a.cm,a.first,a.first,b),a.sel.head=c(a.sel.head),a.sel.anchor=c(a.sel.anchor),a.sel.from=c(a.sel.from),a.sel.to=c(a.sel.to)}function Dc(a,b,c,d){if(a.cm&&!a.cm.curOp)return Ib(a.cm,Dc)(a,b,c,d);if(b.to.line<a.first)return Cc(a,b.text.length-1-(b.to.line-b.from.line)),void 0;if(!(b.from.line>a.lastLine())){if(b.from.line<a.first){var e=b.text.length-1-(a.first-b.from.line);Cc(a,e),b={from:Gc(a.first,0),to:Gc(b.to.line+e,b.to.ch),text:[nf(b.text)],origin:b.origin}}var f=a.lastLine();b.to.line>f&&(b={from:b.from,to:Gc(f,ye(a,f).text.length),text:[b.text[0]],origin:b.origin}),b.removed=ze(a,b.from,b.to),c||(c=xc(a,b,null)),a.cm?Ec(a.cm,b,d,c):pe(a,b,d,c)}}function Ec(a,b,c,d){var e=a.doc,f=a.display,g=b.from,h=b.to,i=!1,j=g.line;a.options.lineWrapping||(j=Ce(Rd(e,ye(e,g.line))),e.iter(j,h.line+1,function(a){return a==f.maxLine?(i=!0,!0):void 0})),Ic(e.sel.head,b.from)||Ic(b.to,e.sel.head)||(a.curOp.cursorActivity=!0),pe(e,b,c,d,E(a)),a.options.lineWrapping||(e.iter(j,g.line+b.text.length,function(a){var b=K(e,a);b>f.maxLineLength&&(f.maxLine=a,f.maxLineLength=b,f.maxLineChanged=!0,i=!1)}),i&&(a.curOp.updateMaxLine=!0)),e.frontier=Math.min(e.frontier,g.line),eb(a,400);var k=b.text.length-(h.line-g.line)-1;if(Lb(a,g.line,h.line+1,k),ef(a,"change")){var l={from:g,to:h,text:b.text,removed:b.removed,origin:b.origin};if(a.curOp.textChanged){for(var m=a.curOp.textChanged;m.next;m=m.next);m.next=l}else a.curOp.textChanged=l}}function Fc(a,b,c,d,e){if(d||(d=c),Ic(d,c)){var f=d;d=c,c=f}"string"==typeof b&&(b=Kf(b)),zc(a,{from:c,to:d,text:b,origin:e},null)}function Gc(a,b){return this instanceof Gc?(this.line=a,this.ch=b,void 0):new Gc(a,b)}function Hc(a,b){return a.line==b.line&&a.ch==b.ch}function Ic(a,b){return a.line<b.line||a.line==b.line&&a.ch<b.ch}function Jc(a,b){return a.line-b.line||a.ch-b.ch}function Kc(a){return Gc(a.line,a.ch)}function Lc(a,b){return Math.max(a.first,Math.min(b,a.first+a.size-1))}function Mc(a,b){if(b.line<a.first)return Gc(a.first,0);var c=a.first+a.size-1;return b.line>c?Gc(c,ye(a,c).text.length):Nc(b,ye(a,b.line).text.length)}function Nc(a,b){var c=a.ch;return null==c||c>b?Gc(a.line,b):0>c?Gc(a.line,0):a}function Oc(a,b){return b>=a.first&&b<a.first+a.size}function Pc(a,b,c,d){if(a.sel.shift||a.sel.extend){var e=a.sel.anchor;if(c){var f=Ic(b,e);f!=Ic(c,e)?(e=b,b=c):f!=Ic(b,c)&&(b=c)}Rc(a,e,b,d)}else Rc(a,b,c||b,d);a.cm&&(a.cm.curOp.userSelChange=!0)}function Qc(a,b,c){var d={anchor:b,head:c};return $e(a,"beforeSelectionChange",a,d),a.cm&&$e(a.cm,"beforeSelectionChange",a.cm,d),d.anchor=Mc(a,d.anchor),d.head=Mc(a,d.head),d}function Rc(a,b,c,d,e){if(!e&&ef(a,"beforeSelectionChange")||a.cm&&ef(a.cm,"beforeSelectionChange")){var f=Qc(a,b,c);c=f.head,b=f.anchor}var g=a.sel;if(g.goalColumn=null,null==d&&(d=Ic(c,g.head)?-1:1),(e||!Hc(b,g.anchor))&&(b=Tc(a,b,d,"push"!=e)),(e||!Hc(c,g.head))&&(c=Tc(a,c,d,"push"!=e)),!Hc(g.anchor,b)||!Hc(g.head,c)){g.anchor=b,g.head=c;var h=Ic(c,b);g.from=h?c:b,g.to=h?b:c,a.cm&&(a.cm.curOp.updateInput=a.cm.curOp.selectionChanged=a.cm.curOp.cursorActivity=!0),bf(a,"cursorActivity",a)}}function Sc(a){Rc(a.doc,a.doc.sel.from,a.doc.sel.to,null,"push")}function Tc(a,b,c,d){var e=!1,f=b,g=c||1;a.cantEdit=!1;a:for(;;){var h=ye(a,f.line);if(h.markedSpans)for(var i=0;i<h.markedSpans.length;++i){var j=h.markedSpans[i],k=j.marker;if((null==j.from||(k.inclusiveLeft?j.from<=f.ch:j.from<f.ch))&&(null==j.to||(k.inclusiveRight?j.to>=f.ch:j.to>f.ch))){if(d&&($e(k,"beforeCursorEnter"),k.explicitlyCleared)){if(h.markedSpans){--i;continue}break}if(!k.atomic)continue;var l=k.find()[0>g?"from":"to"];if(Hc(l,f)&&(l.ch+=g,l.ch<0?l=l.line>a.first?Mc(a,Gc(l.line-1)):null:l.ch>h.text.length&&(l=l.line<a.first+a.size-1?Gc(l.line+1,0):null),!l)){if(e)return d?(a.cantEdit=!0,Gc(a.first,0)):Tc(a,b,c,!0);e=!0,l=b,g=-g}f=l;continue a}}return f}}function Uc(a){var b=Vc(a,a.doc.sel.head,null,a.options.cursorScrollMargin);if(a.state.focused){var c=a.display,d=Df(c.sizer),e=null;if(b.top+d.top<0?e=!0:b.bottom+d.top>(window.innerHeight||document.documentElement.clientHeight)&&(e=!1),null!=e&&!p){var f=zf("div","\u200b",null,"position: absolute; top: "+(b.top-c.viewOffset)+"px; height: "+(b.bottom-b.top+gf)+"px; left: "+b.left+"px; width: 2px;");a.display.lineSpace.appendChild(f),f.scrollIntoView(e),a.display.lineSpace.removeChild(f)}}}function Vc(a,b,c,d){for(null==d&&(d=0);;){var e=!1,f=yb(a,b),g=c&&c!=b?yb(a,c):f,h=Xc(a,Math.min(f.left,g.left),Math.min(f.top,g.top)-d,Math.max(f.left,g.left),Math.max(f.bottom,g.bottom)+d),i=a.doc.scrollTop,j=a.doc.scrollLeft;if(null!=h.scrollTop&&(dc(a,h.scrollTop),Math.abs(a.doc.scrollTop-i)>1&&(e=!0)),null!=h.scrollLeft&&(ec(a,h.scrollLeft),Math.abs(a.doc.scrollLeft-j)>1&&(e=!0)),!e)return f}}function Wc(a,b,c,d,e){var f=Xc(a,b,c,d,e);null!=f.scrollTop&&dc(a,f.scrollTop),null!=f.scrollLeft&&ec(a,f.scrollLeft)}function Xc(a,b,c,d,e){var f=a.display,g=Db(a.display);0>c&&(c=0);var h=f.scroller.clientHeight-gf,i=f.scroller.scrollTop,j={},k=a.doc.height+jb(f),l=g>c,m=e>k-g;if(i>c)j.scrollTop=l?0:c;else if(e>i+h){var n=Math.min(c,(m?k:e)-h);n!=i&&(j.scrollTop=n)}var o=f.scroller.clientWidth-gf,p=f.scroller.scrollLeft;b+=f.gutters.offsetWidth,d+=f.gutters.offsetWidth;var q=f.gutters.offsetWidth,r=q+10>b;return p+q>b||r?(r&&(b=0),j.scrollLeft=Math.max(0,b-10-q)):d>o+p-3&&(j.scrollLeft=d+10-o),j}function Yc(a,b,c){a.curOp.updateScrollPos={scrollLeft:null==b?a.doc.scrollLeft:b,scrollTop:null==c?a.doc.scrollTop:c}}function Zc(a,b,c){var d=a.curOp.updateScrollPos||(a.curOp.updateScrollPos={scrollLeft:a.doc.scrollLeft,scrollTop:a.doc.scrollTop}),e=a.display.scroller;d.scrollTop=Math.max(0,Math.min(e.scrollHeight-e.clientHeight,d.scrollTop+c)),d.scrollLeft=Math.max(0,Math.min(e.scrollWidth-e.clientWidth,d.scrollLeft+b))}function $c(a,b,c,d){var f,e=a.doc;null==c&&(c="add"),"smart"==c&&(a.doc.mode.indent?f=hb(a,b):c="prev");var g=a.options.tabSize,h=ye(e,b),i=kf(h.text,null,g);h.stateAfter&&(h.stateAfter=null);var k,j=h.text.match(/^\s*/)[0];if(d||/\S/.test(h.text)){if("smart"==c&&(k=a.doc.mode.indent(f,h.text.slice(j.length),h.text),k==hf)){if(!d)return;c="prev"}}else k=0,c="not";"prev"==c?k=b>e.first?kf(ye(e,b-1).text,null,g):0:"add"==c?k=i+a.options.indentUnit:"subtract"==c?k=i-a.options.indentUnit:"number"==typeof c&&(k=i+c),k=Math.max(0,k);var l="",m=0;if(a.options.indentWithTabs)for(var n=Math.floor(k/g);n;--n)m+=g,l+="	";k>m&&(l+=mf(k-m)),l!=j?Fc(a.doc,l,Gc(b,0),Gc(b,j.length),"+input"):e.sel.head.line==b&&e.sel.head.ch<j.length&&Rc(e,Gc(b,j.length),Gc(b,j.length),1),h.stateAfter=null}function _c(a,b,c){var d=b,e=b,f=a.doc;return"number"==typeof b?e=ye(f,Lc(f,b)):d=Ce(b),null==d?null:c(e,d)?(Lb(a,d,d+1),e):null}function ad(a,b,c,d,e){function k(){var b=f+c;return b<a.first||b>=a.first+a.size?j=!1:(f=b,i=ye(a,b))}function l(a){var b=(e?Zf:$f)(i,g,c,!0);if(null==b){if(a||!k())return j=!1;g=e?(0>c?Sf:Rf)(i):0>c?i.text.length:0}else g=b;return!0}var f=b.line,g=b.ch,h=c,i=ye(a,f),j=!0;if("char"==d)l();else if("column"==d)l(!0);else if("word"==d||"group"==d)for(var m=null,n="group"==d,o=!0;!(0>c)||l(!o);o=!1){var p=i.text.charAt(g)||"\n",q=vf(p)?"w":n&&"\n"==p?"n":!n||/\s/.test(p)?null:"p";if(!n||o||q||(q="s"),m&&m!=q){0>c&&(c=1,l());break}if(q&&(m=q),c>0&&!l(!o))break}var r=Tc(a,Gc(f,g),h,!0);return j||(r.hitSide=!0),r}function bd(a,b,c,d){var g,e=a.doc,f=b.left;if("page"==d){var h=Math.min(a.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight);g=b.top+c*(h-(0>c?1.5:.5)*Db(a.display))}else"line"==d&&(g=c>0?b.bottom+3:b.top-3);for(;;){var i=Ab(a,f,g);if(!i.outside)break;if(0>c?0>=g:g>=e.height){i.hitSide=!0;break}g+=5*c}return i}function cd(a,b){var c=b.ch,d=b.ch;if(a){(b.xRel<0||d==a.length)&&c?--c:++d;for(var e=a.charAt(c),f=vf(e)?vf:/\s/.test(e)?function(a){return/\s/.test(a)}:function(a){return!/\s/.test(a)&&!vf(a)};c>0&&f(a.charAt(c-1));)--c;for(;d<a.length&&f(a.charAt(d));)++d}return{from:Gc(b.line,c),to:Gc(b.line,d)}}function dd(a,b){Pc(a.doc,Gc(b,0),Mc(a.doc,Gc(b+1,0)))}function gd(a,b,c,d){z.defaults[a]=b,c&&(ed[a]=d?function(a,b,d){d!=hd&&c(a,b,d)}:c)}function nd(a,b){if(b===!0)return b;if(a.copyState)return a.copyState(b);var c={};for(var d in b){var e=b[d];e instanceof Array&&(e=e.concat([])),c[d]=e}return c}function od(a,b,c){return a.startState?a.startState(b,c):!0}function rd(a){return"string"==typeof a?qd[a]:a}function sd(a,b,c){function d(b){b=rd(b);var e=b[a];if(e===!1)return"stop";if(null!=e&&c(e))return!0;if(b.nofallthrough)return"stop";var f=b.fallthrough;if(null==f)return!1;if("[object Array]"!=Object.prototype.toString.call(f))return d(f);for(var g=0,h=f.length;h>g;++g){var i=d(f[g]);if(i)return i}return!1}for(var e=0;e<b.length;++e){var f=d(b[e]);if(f)return"stop"!=f}}function td(a){var b=Nf[a.keyCode];return"Ctrl"==b||"Alt"==b||"Shift"==b||"Mod"==b}function ud(a,b){if(k&&34==a.keyCode&&a["char"])return!1;var c=Nf[a.keyCode];return null==c||a.altGraphKey?!1:(a.altKey&&(c="Alt-"+c),(v?a.metaKey:a.ctrlKey)&&(c="Ctrl-"+c),(v?a.ctrlKey:a.metaKey)&&(c="Cmd-"+c),!b&&a.shiftKey&&(c="Shift-"+c),c)}function vd(a,b){this.pos=this.start=0,this.string=a,this.tabSize=b||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0}function wd(a,b){this.lines=[],this.type=b,this.doc=a}function yd(a,b,c,d,e){if(d&&d.shared)return Ad(a,b,c,d,e);if(a.cm&&!a.cm.curOp)return Ib(a.cm,yd)(a,b,c,d,e);var f=new wd(a,e);if(d&&rf(d,f),Ic(c,b)||Hc(b,c)&&f.clearWhenEmpty!==!1)return f;if(f.replacedWith&&(f.collapsed=!0,f.replacedWith=zf("span",[f.replacedWith],"CodeMirror-widget"),d.handleMouseEvents||(f.replacedWith.ignoreEvents=!0)),f.collapsed){if(Qd(a,b.line,b,c,f)||b.line!=c.line&&Qd(a,c.line,b,c,f))throw new Error("Inserting collapsed marker partially overlapping an existing one");y=!0}f.addToHistory&&Je(a,{from:b,to:c,origin:"markText"},{head:a.sel.head,anchor:a.sel.anchor},0/0);var i,g=b.line,h=a.cm;return a.iter(g,c.line+1,function(d){h&&f.collapsed&&!h.options.lineWrapping&&Rd(a,d)==h.display.maxLine&&(i=!0);var e={from:null,to:null,marker:f};g==b.line&&(e.from=b.ch),g==c.line&&(e.to=c.ch),f.collapsed&&g!=b.line&&Be(d,0),Dd(d,e),++g}),f.collapsed&&a.iter(b.line,c.line+1,function(b){Sd(a,b)&&Be(b,0)}),f.clearOnEnter&&Ye(f,"beforeCursorEnter",function(){f.clear()}),f.readOnly&&(x=!0,(a.history.done.length||a.history.undone.length)&&a.clearHistory()),f.collapsed&&(f.id=++xd,f.atomic=!0),h&&(i&&(h.curOp.updateMaxLine=!0),(f.className||f.title||f.startStyle||f.endStyle||f.collapsed)&&Lb(h,b.line,c.line+1),f.atomic&&Sc(h)),bf(h,"markerAdded",h,f),f}function zd(a,b){this.markers=a,this.primary=b;for(var c=0,d=this;c<a.length;++c)a[c].parent=this,Ye(a[c],"clear",function(){d.clear()})}function Ad(a,b,c,d,e){d=rf(d),d.shared=!1;var f=[yd(a,b,c,d,e)],g=f[0],h=d.replacedWith;return we(a,function(a){h&&(d.replacedWith=h.cloneNode(!0)),f.push(yd(a,Mc(a,b),Mc(a,c),d,e));for(var i=0;i<a.linked.length;++i)if(a.linked[i].isParent)return;g=nf(f)}),new zd(f,g)}function Bd(a,b){if(a)for(var c=0;c<a.length;++c){var d=a[c];if(d.marker==b)return d}}function Cd(a,b){for(var c,d=0;d<a.length;++d)a[d]!=b&&(c||(c=[])).push(a[d]);return c}function Dd(a,b){a.markedSpans=a.markedSpans?a.markedSpans.concat([b]):[b],b.marker.attachLine(a)}function Ed(a,b,c){if(a)for(var e,d=0;d<a.length;++d){var f=a[d],g=f.marker,h=null==f.from||(g.inclusiveLeft?f.from<=b:f.from<b);if(h||f.from==b&&"bookmark"==g.type&&(!c||!f.marker.insertLeft)){var i=null==f.to||(g.inclusiveRight?f.to>=b:f.to>b);(e||(e=[])).push({from:f.from,to:i?null:f.to,marker:g})}}return e}function Fd(a,b,c){if(a)for(var e,d=0;d<a.length;++d){var f=a[d],g=f.marker,h=null==f.to||(g.inclusiveRight?f.to>=b:f.to>b);if(h||f.from==b&&"bookmark"==g.type&&(!c||f.marker.insertLeft)){var i=null==f.from||(g.inclusiveLeft?f.from<=b:f.from<b);(e||(e=[])).push({from:i?null:f.from-b,to:null==f.to?null:f.to-b,marker:g})}}return e}function Gd(a,b){var c=Oc(a,b.from.line)&&ye(a,b.from.line).markedSpans,d=Oc(a,b.to.line)&&ye(a,b.to.line).markedSpans;if(!c&&!d)return null;var e=b.from.ch,f=b.to.ch,g=Hc(b.from,b.to),h=Ed(c,e,g),i=Fd(d,f,g),j=1==b.text.length,k=nf(b.text).length+(j?e:0);if(h)for(var l=0;l<h.length;++l){var m=h[l];if(null==m.to){var n=Bd(i,m.marker);n?j&&(m.to=null==n.to?null:n.to+k):m.to=e}}if(i)for(var l=0;l<i.length;++l){var m=i[l];if(null!=m.to&&(m.to+=k),null==m.from){var n=Bd(h,m.marker);n||(m.from=k,j&&(h||(h=[])).push(m))}else m.from+=k,j&&(h||(h=[])).push(m)}h&&(h=Hd(h)),i&&i!=h&&(i=Hd(i));var o=[h];if(!j){var q,p=b.text.length-2;if(p>0&&h)for(var l=0;l<h.length;++l)null==h[l].to&&(q||(q=[])).push({from:null,to:null,marker:h[l].marker});for(var l=0;p>l;++l)o.push(q);o.push(i)}return o}function Hd(a){for(var b=0;b<a.length;++b){var c=a[b];null!=c.from&&c.from==c.to&&c.marker.clearWhenEmpty!==!1&&a.splice(b--,1)}return a.length?a:null}function Id(a,b){var c=Le(a,b),d=Gd(a,b);if(!c)return d;if(!d)return c;for(var e=0;e<c.length;++e){var f=c[e],g=d[e];if(f&&g)a:for(var h=0;h<g.length;++h){for(var i=g[h],j=0;j<f.length;++j)if(f[j].marker==i.marker)continue a;f.push(i)}else g&&(c[e]=g)}return c}function Jd(a,b,c){var d=null;if(a.iter(b.line,c.line+1,function(a){if(a.markedSpans)for(var b=0;b<a.markedSpans.length;++b){var c=a.markedSpans[b].marker;!c.readOnly||d&&-1!=pf(d,c)||(d||(d=[])).push(c)}}),!d)return null;for(var e=[{from:b,to:c}],f=0;f<d.length;++f)for(var g=d[f],h=g.find(),i=0;i<e.length;++i){var j=e[i];if(!Ic(j.to,h.from)&&!Ic(h.to,j.from)){var k=[i,1];(Ic(j.from,h.from)||!g.inclusiveLeft&&Hc(j.from,h.from))&&k.push({from:j.from,to:h.from}),(Ic(h.to,j.to)||!g.inclusiveRight&&Hc(j.to,h.to))&&k.push({from:h.to,to:j.to}),e.splice.apply(e,k),i+=k.length-1}}return e}function Kd(a){return a.inclusiveLeft?-1:0}function Ld(a){return a.inclusiveRight?1:0}function Md(a,b){var c=a.lines.length-b.lines.length;if(0!=c)return c;var d=a.find(),e=b.find(),f=Jc(d.from,e.from)||Kd(a)-Kd(b);if(f)return-f;var g=Jc(d.to,e.to)||Ld(a)-Ld(b);return g?g:b.id-a.id}function Nd(a,b){var d,c=y&&a.markedSpans;if(c)for(var e,f=0;f<c.length;++f)e=c[f],e.marker.collapsed&&null==(b?e.from:e.to)&&(!d||Md(d,e.marker)<0)&&(d=e.marker);return d}function Od(a){return Nd(a,!0)}function Pd(a){return Nd(a,!1)}function Qd(a,b,c,d,e){var f=ye(a,b),g=y&&f.markedSpans;if(g)for(var h=0;h<g.length;++h){var i=g[h];if(i.marker.collapsed){var j=i.marker.find(!0),k=Jc(j.from,c)||Kd(i.marker)-Kd(e),l=Jc(j.to,d)||Ld(i.marker)-Ld(e);if(!(k>=0&&0>=l||0>=k&&l>=0)&&(0>=k&&(Jc(j.to,c)||Ld(i.marker)-Kd(e))>0||k>=0&&(Jc(j.from,d)||Kd(i.marker)-Ld(e))<0))return!0}}}function Rd(a,b){for(var c;c=Od(b);)b=ye(a,c.find().from.line);return b}function Sd(a,b){var c=y&&b.markedSpans;if(c)for(var d,e=0;e<c.length;++e)if(d=c[e],d.marker.collapsed){if(null==d.from)return!0;if(!d.marker.replacedWith&&0==d.from&&d.marker.inclusiveLeft&&Td(a,b,d))return!0}}function Td(a,b,c){if(null==c.to){var d=c.marker.find().to,e=ye(a,d.line);return Td(a,e,Bd(e.markedSpans,c.marker))}if(c.marker.inclusiveRight&&c.to==b.text.length)return!0;for(var f,g=0;g<b.markedSpans.length;++g)if(f=b.markedSpans[g],f.marker.collapsed&&!f.marker.replacedWith&&f.from==c.to&&(null==f.to||f.to!=c.from)&&(f.marker.inclusiveLeft||c.marker.inclusiveRight)&&Td(a,b,f))return!0}function Ud(a){var b=a.markedSpans;if(b){for(var c=0;c<b.length;++c)b[c].marker.detachLine(a);a.markedSpans=null}}function Vd(a,b){if(b){for(var c=0;c<b.length;++c)b[c].marker.attachLine(a);a.markedSpans=b}}function Xd(a){return function(){var b=!this.cm.curOp;b&&Gb(this.cm);try{var c=a.apply(this,arguments)}finally{b&&Hb(this.cm)}return c}}function Yd(a){return null!=a.height?a.height:(a.node.parentNode&&1==a.node.parentNode.nodeType||Bf(a.cm.display.measure,zf("div",[a.node],null,"position: relative")),a.height=a.node.offsetHeight)}function Zd(a,b,c,d){var e=new Wd(a,c,d);return e.noHScroll&&(a.display.alignWidgets=!0),_c(a,b,function(b){var c=b.widgets||(b.widgets=[]);if(null==e.insertAt?c.push(e):c.splice(Math.min(c.length-1,Math.max(0,e.insertAt)),0,e),e.line=b,!Sd(a.doc,b)||e.showIfHidden){var d=Ee(a,b)<a.doc.scrollTop;Be(b,b.height+Yd(e)),d&&Zc(a,0,e.height),a.curOp.forceUpdate=!0}return!0}),e}function _d(a,b,c,d){a.text=b,a.stateAfter&&(a.stateAfter=null),a.styles&&(a.styles=null),null!=a.order&&(a.order=null),Ud(a),Vd(a,c);var e=d?d(a):1;e!=a.height&&Be(a,e)}function ae(a){a.parent=null,Ud(a)}function be(a,b,c,d,e,f){var g=c.flattenSpans;null==g&&(g=a.options.flattenSpans);var k,h=0,i=null,j=new vd(b,a.options.tabSize);for(""==b&&c.blankLine&&c.blankLine(d);!j.eol();){if(j.pos>a.options.maxHighlightLength?(g=!1,f&&ee(a,b,d,j.pos),j.pos=b.length,k=null):k=c.token(j,d),a.options.addModeClass){var l=z.innerMode(c,d).mode.name;l&&(k="m-"+(k?l+" "+k:l))}g&&i==k||(h<j.start&&e(j.start,i),h=j.start,i=k),j.start=j.pos}for(;h<j.pos;){var m=Math.min(j.pos,h+5e4);e(m,i),h=m}}function ce(a,b,c,d){var e=[a.state.modeGen];be(a,b.text,a.doc.mode,c,function(a,b){e.push(a,b)},d);for(var f=0;f<a.state.overlays.length;++f){var g=a.state.overlays[f],h=1,i=0;be(a,b.text,g.mode,!0,function(a,b){for(var c=h;a>i;){var d=e[h];d>a&&e.splice(h,1,a,e[h+1],d),h+=2,i=Math.min(a,d)}if(b)if(g.opaque)e.splice(c,h-c,a,b),h=c+2;else for(;h>c;c+=2){var f=e[c+1];e[c+1]=f?f+" "+b:b}})}return e}function de(a,b){return b.styles&&b.styles[0]==a.state.modeGen||(b.styles=ce(a,b,b.stateAfter=hb(a,Ce(b)))),b.styles}function ee(a,b,c,d){var e=a.doc.mode,f=new vd(b,a.options.tabSize);for(f.start=f.pos=d||0,""==b&&e.blankLine&&e.blankLine(c);!f.eol()&&f.pos<=a.options.maxHighlightLength;)e.token(f,c),f.start=f.pos}function he(a,b){if(!a)return null;for(;;){var c=a.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!c)break;a=a.slice(0,c.index)+a.slice(c.index+c[0].length);var d=c[1]?"bgClass":"textClass";null==b[d]?b[d]=c[2]:new RegExp("(?:^|s)"+c[2]+"(?:$|s)").test(b[d])||(b[d]+=" "+c[2])}if(/^\s*$/.test(a))return null;var e=b.cm.options.addModeClass?ge:fe;return e[a]||(e[a]=a.replace(/\S+/g,"cm-$&"))}function ie(a,b,c,d){for(var e,f=b,i=!0;e=Od(f);)f=ye(a.doc,e.find().from.line);var j={pre:zf("pre"),col:0,pos:0,measure:null,measuredSomething:!1,cm:a,copyWidgets:d};do{f.text&&(i=!1),j.measure=f==b&&c,j.pos=0,j.addToken=j.measure?le:ke,(g||h)&&a.getOption("lineWrapping")&&(j.addToken=me(j.addToken));var k=oe(f,j,de(a,f));c&&f==b&&!j.measuredSomething&&(c[0]=j.pre.appendChild(Jf(a.display.measure)),j.measuredSomething=!0),k&&(f=ye(a.doc,k.to.line))}while(k);!c||j.measuredSomething||c[0]||(c[0]=j.pre.appendChild(i?zf("span","\xa0"):Jf(a.display.measure))),j.pre.firstChild||Sd(a.doc,b)||j.pre.appendChild(document.createTextNode("\xa0"));var l;if(c&&g&&(l=Fe(f))){var m=l.length-1;l[m].from==l[m].to&&--m;var n=l[m],o=l[m-1];if(n.from+1==n.to&&o&&n.level<o.level){var p=c[j.pos-1];p&&p.parentNode.insertBefore(p.measureRight=Jf(a.display.measure),p.nextSibling)}}var q=j.textClass?j.textClass+" "+(b.textClass||""):b.textClass;return q&&(j.pre.className=q),$e(a,"renderLine",a,b,j.pre),j}function je(a){var b=zf("span","\u2022","cm-invalidchar");return b.title="\\u"+a.charCodeAt(0).toString(16),b}function ke(a,b,c,d,e,f){if(b){var g=a.cm.options.specialChars;if(g.test(b))for(var h=document.createDocumentFragment(),i=0;;){g.lastIndex=i;var j=g.exec(b),k=j?j.index-i:b.length-i;if(k&&(h.appendChild(document.createTextNode(b.slice(i,i+k))),a.col+=k),!j)break;if(i+=k+1,"	"==j[0]){var l=a.cm.options.tabSize,m=l-a.col%l;h.appendChild(zf("span",mf(m),"cm-tab")),a.col+=m
-}else{var n=a.cm.options.specialCharPlaceholder(j[0]);h.appendChild(n),a.col+=1}}else{a.col+=b.length;var h=document.createTextNode(b)}if(c||d||e||a.measure){var o=c||"";d&&(o+=d),e&&(o+=e);var n=zf("span",[h],o);return f&&(n.title=f),a.pre.appendChild(n)}a.pre.appendChild(h)}}function le(a,c,d,e,f){for(var g=a.cm.options.lineWrapping,h=0;h<c.length;++h){for(var i=0==h,j=h+1;j<c.length&&yf(c.charAt(j));)++j;var k=c.slice(h,j);h=j-1,h&&g&&Ff(c,h)&&a.pre.appendChild(zf("wbr"));var l=a.measure[a.pos],m=a.measure[a.pos]=ke(a,k,d,i&&e,h==c.length-1&&f);l&&(m.leftSide=l.leftSide||l),b&&g&&" "==k&&h&&!/\s/.test(c.charAt(h-1))&&h<c.length-1&&!/\s/.test(c.charAt(h+1))&&(m.style.whiteSpace="normal"),a.pos+=k.length}c.length&&(a.measuredSomething=!0)}function me(a){function b(a){for(var b=" ",c=0;c<a.length-2;++c)b+=c%2?" ":"\xa0";return b+=" "}return function(c,d,e,f,g,h){return a(c,d.replace(/ {3,}/g,b),e,f,g,h)}}function ne(a,b,c,d){var e=!d&&c.replacedWith;if(e&&(a.copyWidgets&&(e=e.cloneNode(!0)),a.pre.appendChild(e),a.measure)){if(b)a.measure[a.pos]=e;else{var f=Jf(a.cm.display.measure);if("bookmark"!=c.type||c.insertLeft){if(a.measure[a.pos])return;a.measure[a.pos]=a.pre.insertBefore(f,e)}else a.measure[a.pos]=a.pre.appendChild(f)}a.measuredSomething=!0}a.pos+=b}function oe(a,b,c){var d=a.markedSpans,e=a.text,f=0;if(d)for(var k,m,n,o,p,q,h=e.length,i=0,g=1,j="",l=0;;){if(l==i){m=n=o=p="",q=null,l=1/0;for(var r=[],s=0;s<d.length;++s){var t=d[s],u=t.marker;t.from<=i&&(null==t.to||t.to>i)?(null!=t.to&&l>t.to&&(l=t.to,n=""),u.className&&(m+=" "+u.className),u.startStyle&&t.from==i&&(o+=" "+u.startStyle),u.endStyle&&t.to==l&&(n+=" "+u.endStyle),u.title&&!p&&(p=u.title),u.collapsed&&(!q||Md(q.marker,u)<0)&&(q=t)):t.from>i&&l>t.from&&(l=t.from),"bookmark"==u.type&&t.from==i&&u.replacedWith&&r.push(u)}if(q&&(q.from||0)==i&&(ne(b,(null==q.to?h:q.to)-i,q.marker,null==q.from),null==q.to))return q.marker.find();if(!q&&r.length)for(var s=0;s<r.length;++s)ne(b,0,r[s])}if(i>=h)break;for(var v=Math.min(h,l);;){if(j){var w=i+j.length;if(!q){var x=w>v?j.slice(0,v-i):j;b.addToken(b,x,k?k+m:m,o,i+x.length==l?n:"",p)}if(w>=v){j=j.slice(v-i),i=v;break}i=w,o=""}j=e.slice(f,f=c[g++]),k=he(c[g++],b)}}else for(var g=1;g<c.length;g+=2)b.addToken(b,e.slice(f,f=c[g]),he(c[g+1],b))}function pe(a,b,c,d,e){function f(a){return c?c[a]:null}function g(a,c,d){_d(a,c,d,e),bf(a,"change",a,b)}var h=b.from,i=b.to,j=b.text,k=ye(a,h.line),l=ye(a,i.line),m=nf(j),n=f(j.length-1),o=i.line-h.line;if(0!=h.ch||0!=i.ch||""!=m||a.cm&&!a.cm.options.wholeLineUpdateBefore)if(k==l)if(1==j.length)g(k,k.text.slice(0,h.ch)+m+k.text.slice(i.ch),n);else{for(var r=[],p=1,q=j.length-1;q>p;++p)r.push(new $d(j[p],f(p),e));r.push(new $d(m+k.text.slice(i.ch),n,e)),g(k,k.text.slice(0,h.ch)+j[0],f(0)),a.insert(h.line+1,r)}else if(1==j.length)g(k,k.text.slice(0,h.ch)+j[0]+l.text.slice(i.ch),f(0)),a.remove(h.line+1,o);else{g(k,k.text.slice(0,h.ch)+j[0],f(0)),g(l,m+l.text.slice(i.ch),n);for(var p=1,q=j.length-1,r=[];q>p;++p)r.push(new $d(j[p],f(p),e));o>1&&a.remove(h.line+1,o-1),a.insert(h.line+1,r)}else{for(var p=0,q=j.length-1,r=[];q>p;++p)r.push(new $d(j[p],f(p),e));g(l,l.text,n),o&&a.remove(h.line,o),r.length&&a.insert(h.line,r)}bf(a,"change",a,b),Rc(a,d.anchor,d.head,null,!0)}function qe(a){this.lines=a,this.parent=null;for(var b=0,c=a.length,d=0;c>b;++b)a[b].parent=this,d+=a[b].height;this.height=d}function re(a){this.children=a;for(var b=0,c=0,d=0,e=a.length;e>d;++d){var f=a[d];b+=f.chunkSize(),c+=f.height,f.parent=this}this.size=b,this.height=c,this.parent=null}function we(a,b,c){function d(a,e,f){if(a.linked)for(var g=0;g<a.linked.length;++g){var h=a.linked[g];if(h.doc!=e){var i=f&&h.sharedHist;(!c||i)&&(b(h.doc,i),d(h.doc,a,i))}}}d(a,null,!0)}function xe(a,b){if(b.cm)throw new Error("This document is already in use.");a.doc=b,b.cm=a,F(a),B(a),a.options.lineWrapping||L(a),a.options.mode=b.modeOption,Lb(a)}function ye(a,b){for(b-=a.first;!a.lines;)for(var c=0;;++c){var d=a.children[c],e=d.chunkSize();if(e>b){a=d;break}b-=e}return a.lines[b]}function ze(a,b,c){var d=[],e=b.line;return a.iter(b.line,c.line+1,function(a){var f=a.text;e==c.line&&(f=f.slice(0,c.ch)),e==b.line&&(f=f.slice(b.ch)),d.push(f),++e}),d}function Ae(a,b,c){var d=[];return a.iter(b,c,function(a){d.push(a.text)}),d}function Be(a,b){for(var c=b-a.height,d=a;d;d=d.parent)d.height+=c}function Ce(a){if(null==a.parent)return null;for(var b=a.parent,c=pf(b.lines,a),d=b.parent;d;b=d,d=d.parent)for(var e=0;d.children[e]!=b;++e)c+=d.children[e].chunkSize();return c+b.first}function De(a,b){var c=a.first;a:do{for(var d=0,e=a.children.length;e>d;++d){var f=a.children[d],g=f.height;if(g>b){a=f;continue a}b-=g,c+=f.chunkSize()}return c}while(!a.lines);for(var d=0,e=a.lines.length;e>d;++d){var h=a.lines[d],i=h.height;if(i>b)break;b-=i}return c+d}function Ee(a,b){b=Rd(a.doc,b);for(var c=0,d=b.parent,e=0;e<d.lines.length;++e){var f=d.lines[e];if(f==b)break;c+=f.height}for(var g=d.parent;g;d=g,g=d.parent)for(var e=0;e<g.children.length;++e){var h=g.children[e];if(h==d)break;c+=h.height}return c}function Fe(a){var b=a.order;return null==b&&(b=a.order=_f(a.text)),b}function Ge(a){return{done:[],undone:[],undoDepth:1/0,lastTime:0,lastOp:null,lastOrigin:null,generation:a||1,maxGeneration:a||1}}function He(a,b,c,d){var e=b["spans_"+a.id],f=0;a.iter(Math.max(a.first,c),Math.min(a.first+a.size,d),function(c){c.markedSpans&&((e||(e=b["spans_"+a.id]={}))[f]=c.markedSpans),++f})}function Ie(a,b){var c={line:b.from.line,ch:b.from.ch},d={from:c,to:vc(b),text:ze(a,b.from,b.to)};return He(a,d,b.from.line,b.to.line+1),we(a,function(a){He(a,d,b.from.line,b.to.line+1)},!0),d}function Je(a,b,c,d){var e=a.history;e.undone.length=0;var f=+new Date,g=nf(e.done);if(g&&(e.lastOp==d||e.lastOrigin==b.origin&&b.origin&&("+"==b.origin.charAt(0)&&a.cm&&e.lastTime>f-a.cm.options.historyEventDelay||"*"==b.origin.charAt(0)))){var h=nf(g.changes);Hc(b.from,b.to)&&Hc(b.from,h.to)?h.to=vc(b):g.changes.push(Ie(a,b)),g.anchorAfter=c.anchor,g.headAfter=c.head}else for(g={changes:[Ie(a,b)],generation:e.generation,anchorBefore:a.sel.anchor,headBefore:a.sel.head,anchorAfter:c.anchor,headAfter:c.head},e.done.push(g);e.done.length>e.undoDepth;)e.done.shift();e.generation=++e.maxGeneration,e.lastTime=f,e.lastOp=d,e.lastOrigin=b.origin,h||$e(a,"historyAdded")}function Ke(a){if(!a)return null;for(var c,b=0;b<a.length;++b)a[b].marker.explicitlyCleared?c||(c=a.slice(0,b)):c&&c.push(a[b]);return c?c.length?c:null:a}function Le(a,b){var c=b["spans_"+a.id];if(!c)return null;for(var d=0,e=[];d<b.text.length;++d)e.push(Ke(c[d]));return e}function Me(a,b){for(var c=0,d=[];c<a.length;++c){var e=a[c],f=e.changes,g=[];d.push({changes:g,anchorBefore:e.anchorBefore,headBefore:e.headBefore,anchorAfter:e.anchorAfter,headAfter:e.headAfter});for(var h=0;h<f.length;++h){var j,i=f[h];if(g.push({from:i.from,to:i.to,text:i.text}),b)for(var k in i)(j=k.match(/^spans_(\d+)$/))&&pf(b,Number(j[1]))>-1&&(nf(g)[k]=i[k],delete i[k])}}return d}function Ne(a,b,c,d){c<a.line?a.line+=d:b<a.line&&(a.line=b,a.ch=0)}function Oe(a,b,c,d){for(var e=0;e<a.length;++e){for(var f=a[e],g=!0,h=0;h<f.changes.length;++h){var i=f.changes[h];if(f.copied||(i.from=Kc(i.from),i.to=Kc(i.to)),c<i.from.line)i.from.line+=d,i.to.line+=d;else if(b<=i.to.line){g=!1;break}}f.copied||(f.anchorBefore=Kc(f.anchorBefore),f.headBefore=Kc(f.headBefore),f.anchorAfter=Kc(f.anchorAfter),f.readAfter=Kc(f.headAfter),f.copied=!0),g?(Ne(f.anchorBefore),Ne(f.headBefore),Ne(f.anchorAfter),Ne(f.headAfter)):(a.splice(0,e+1),e=0)}}function Pe(a,b){var c=b.from.line,d=b.to.line,e=b.text.length-(d-c)-1;Oe(a.done,c,d,e),Oe(a.undone,c,d,e)}function Qe(){Ve(this)}function Re(a){return a.stop||(a.stop=Qe),a}function Se(a){a.preventDefault?a.preventDefault():a.returnValue=!1}function Te(a){a.stopPropagation?a.stopPropagation():a.cancelBubble=!0}function Ue(a){return null!=a.defaultPrevented?a.defaultPrevented:0==a.returnValue}function Ve(a){Se(a),Te(a)}function We(a){return a.target||a.srcElement}function Xe(a){var b=a.which;return null==b&&(1&a.button?b=1:2&a.button?b=3:4&a.button&&(b=2)),s&&a.ctrlKey&&1==b&&(b=3),b}function Ye(a,b,c){if(a.addEventListener)a.addEventListener(b,c,!1);else if(a.attachEvent)a.attachEvent("on"+b,c);else{var d=a._handlers||(a._handlers={}),e=d[b]||(d[b]=[]);e.push(c)}}function Ze(a,b,c){if(a.removeEventListener)a.removeEventListener(b,c,!1);else if(a.detachEvent)a.detachEvent("on"+b,c);else{var d=a._handlers&&a._handlers[b];if(!d)return;for(var e=0;e<d.length;++e)if(d[e]==c){d.splice(e,1);break}}}function $e(a,b){var c=a._handlers&&a._handlers[b];if(c)for(var d=Array.prototype.slice.call(arguments,2),e=0;e<c.length;++e)c[e].apply(null,d)}function bf(a,b){function e(a){return function(){a.apply(null,d)}}var c=a._handlers&&a._handlers[b];if(c){var d=Array.prototype.slice.call(arguments,2);_e||(++af,_e=[],setTimeout(df,0));for(var f=0;f<c.length;++f)_e.push(e(c[f]))}}function cf(a,b,c){return $e(a,c||b.type,a,b),Ue(b)||b.codemirrorIgnore}function df(){--af;var a=_e;_e=null;for(var b=0;b<a.length;++b)a[b]()}function ef(a,b){var c=a._handlers&&a._handlers[b];return c&&c.length>0}function ff(a){a.prototype.on=function(a,b){Ye(this,a,b)},a.prototype.off=function(a,b){Ze(this,a,b)}}function jf(){this.id=null}function kf(a,b,c,d,e){null==b&&(b=a.search(/[^\s\u00a0]/),-1==b&&(b=a.length));for(var f=d||0,g=e||0;b>f;++f)"	"==a.charAt(f)?g+=c-g%c:++g;return g}function mf(a){for(;lf.length<=a;)lf.push(nf(lf)+" ");return lf[a]}function nf(a){return a[a.length-1]}function of(a){if(q)a.selectionStart=0,a.selectionEnd=a.value.length;else try{a.select()}catch(b){}}function pf(a,b){if(a.indexOf)return a.indexOf(b);for(var c=0,d=a.length;d>c;++c)if(a[c]==b)return c;return-1}function qf(a,b){function c(){}c.prototype=a;var d=new c;return b&&rf(b,d),d}function rf(a,b){b||(b={});for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function sf(a){for(var b=[],c=0;a>c;++c)b.push(void 0);return b}function tf(a){var b=Array.prototype.slice.call(arguments,1);return function(){return a.apply(null,b)}}function vf(a){return/\w/.test(a)||a>"\x80"&&(a.toUpperCase()!=a.toLowerCase()||uf.test(a))}function wf(a){for(var b in a)if(a.hasOwnProperty(b)&&a[b])return!1;return!0}function yf(a){return a.charCodeAt(0)>=768&&xf.test(a)}function zf(a,b,c,d){var e=document.createElement(a);if(c&&(e.className=c),d&&(e.style.cssText=d),"string"==typeof b)Cf(e,b);else if(b)for(var f=0;f<b.length;++f)e.appendChild(b[f]);return e}function Af(a){for(var b=a.childNodes.length;b>0;--b)a.removeChild(a.firstChild);return a}function Bf(a,b){return Af(a).appendChild(b)}function Cf(a,b){d?(a.innerHTML="",a.appendChild(document.createTextNode(b))):a.textContent=b}function Df(a){return a.getBoundingClientRect()}function Ff(){return!1}function Hf(a){if(null!=Gf)return Gf;var b=zf("div",null,null,"width: 50px; height: 50px; overflow-x: scroll");return Bf(a,b),b.offsetWidth&&(Gf=b.offsetHeight-b.clientHeight),Gf||0}function Jf(a){if(null==If){var b=zf("span","\u200b");Bf(a,zf("span",[b,document.createTextNode("x")])),0!=a.firstChild.offsetHeight&&(If=b.offsetWidth<=1&&b.offsetHeight>2&&!c)}return If?zf("span","\u200b"):zf("span","\xa0",null,"display: inline-block; width: 1px; margin-right: -1px")}function Of(a,b,c,d){if(!a)return d(b,c,"ltr");for(var e=!1,f=0;f<a.length;++f){var g=a[f];(g.from<c&&g.to>b||b==c&&g.to==b)&&(d(Math.max(g.from,b),Math.min(g.to,c),1==g.level?"rtl":"ltr"),e=!0)}e||d(b,c,"ltr")}function Pf(a){return a.level%2?a.to:a.from}function Qf(a){return a.level%2?a.from:a.to}function Rf(a){var b=Fe(a);return b?Pf(b[0]):0}function Sf(a){var b=Fe(a);return b?Qf(nf(b)):a.text.length}function Tf(a,b){var c=ye(a.doc,b),d=Rd(a.doc,c);d!=c&&(b=Ce(d));var e=Fe(d),f=e?e[0].level%2?Sf(d):Rf(d):0;return Gc(b,f)}function Uf(a,b){for(var c,d;c=Pd(d=ye(a.doc,b));)b=c.find().to.line;var e=Fe(d),f=e?e[0].level%2?Rf(d):Sf(d):d.text.length;return Gc(b,f)}function Vf(a,b,c){var d=a[0].level;return b==d?!0:c==d?!1:c>b}function Xf(a,b){Wf=null;for(var d,c=0;c<a.length;++c){var e=a[c];if(e.from<b&&e.to>b)return c;if(e.from==b||e.to==b){if(null!=d)return Vf(a,e.level,a[d].level)?(e.from!=e.to&&(Wf=d),c):(e.from!=e.to&&(Wf=c),d);d=c}}return d}function Yf(a,b,c,d){if(!d)return b+c;do b+=c;while(b>0&&yf(a.text.charAt(b)));return b}function Zf(a,b,c,d){var e=Fe(a);if(!e)return $f(a,b,c,d);for(var f=Xf(e,b),g=e[f],h=Yf(a,b,g.level%2?-c:c,d);;){if(h>g.from&&h<g.to)return h;if(h==g.from||h==g.to)return Xf(e,h)==f?h:(g=e[f+=c],c>0==g.level%2?g.to:g.from);if(g=e[f+=c],!g)return null;h=c>0==g.level%2?Yf(a,g.to,-1,d):Yf(a,g.from,1,d)}}function $f(a,b,c,d){var e=b+c;if(d)for(;e>0&&yf(a.text.charAt(e));)e+=c;return 0>e||e>a.text.length?null:e}var a=/gecko\/\d/i.test(navigator.userAgent),b=/MSIE \d/.test(navigator.userAgent),c=b&&(null==document.documentMode||document.documentMode<8),d=b&&(null==document.documentMode||document.documentMode<9),e=b&&(null==document.documentMode||document.documentMode<10),f=/Trident\/([7-9]|\d{2,})\./.test(navigator.userAgent),g=b||f,h=/WebKit\//.test(navigator.userAgent),i=h&&/Qt\/\d+\.\d+/.test(navigator.userAgent),j=/Chrome\//.test(navigator.userAgent),k=/Opera\//.test(navigator.userAgent),l=/Apple Computer/.test(navigator.vendor),m=/KHTML\//.test(navigator.userAgent),n=/Mac OS X 1\d\D([7-9]|\d\d)\D/.test(navigator.userAgent),o=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(navigator.userAgent),p=/PhantomJS/.test(navigator.userAgent),q=/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent),r=q||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(navigator.userAgent),s=q||/Mac/.test(navigator.platform),t=/win/i.test(navigator.platform),u=k&&navigator.userAgent.match(/Version\/(\d*\.\d*)/);u&&(u=Number(u[1])),u&&u>=15&&(k=!1,h=!0);var Cb,Wb,Xb,v=s&&(i||k&&(null==u||12.11>u)),w=a||g&&!d,x=!1,y=!1,Fb=0,ac=0,fc=0,gc=null;g?gc=-.53:a?gc=15:j?gc=-.7:l&&(gc=-1/3);var kc,tc,oc=null,vc=z.changeEnd=function(a){return a.text?Gc(a.from.line+a.text.length-1,nf(a.text).length+(1==a.text.length?a.from.ch:0)):a.to};z.Pos=Gc,z.prototype={constructor:z,focus:function(){window.focus(),Qb(this),Nb(this)},setOption:function(a,b){var c=this.options,d=c[a];(c[a]!=b||"mode"==a)&&(c[a]=b,ed.hasOwnProperty(a)&&Ib(this,ed[a])(this,b,d))},getOption:function(a){return this.options[a]},getDoc:function(){return this.doc},addKeyMap:function(a,b){this.state.keyMaps[b?"push":"unshift"](a)},removeKeyMap:function(a){for(var b=this.state.keyMaps,c=0;c<b.length;++c)if(b[c]==a||"string"!=typeof b[c]&&b[c].name==a)return b.splice(c,1),!0},addOverlay:Ib(null,function(a,b){var c=a.token?a:z.getMode(this.options,a);if(c.startState)throw new Error("Overlays may not be stateful.");this.state.overlays.push({mode:c,modeSpec:a,opaque:b&&b.opaque}),this.state.modeGen++,Lb(this)}),removeOverlay:Ib(null,function(a){for(var b=this.state.overlays,c=0;c<b.length;++c){var d=b[c].modeSpec;if(d==a||"string"==typeof a&&d.name==a)return b.splice(c,1),this.state.modeGen++,Lb(this),void 0}}),indentLine:Ib(null,function(a,b,c){"string"!=typeof b&&"number"!=typeof b&&(b=null==b?this.options.smartIndent?"smart":"prev":b?"add":"subtract"),Oc(this.doc,a)&&$c(this,a,b,c)}),indentSelection:Ib(null,function(a){var b=this.doc.sel;if(Hc(b.from,b.to))return $c(this,b.from.line,a,!0);for(var c=b.to.line-(b.to.ch?0:1),d=b.from.line;c>=d;++d)$c(this,d,a)}),getTokenAt:function(a,b){var c=this.doc;a=Mc(c,a);for(var d=hb(this,a.line,b),e=this.doc.mode,f=ye(c,a.line),g=new vd(f.text,this.options.tabSize);g.pos<a.ch&&!g.eol();){g.start=g.pos;var h=e.token(g,d)}return{start:g.start,end:g.pos,string:g.current(),className:h||null,type:h||null,state:d}},getTokenTypeAt:function(a){a=Mc(this.doc,a);var b=de(this,ye(this.doc,a.line)),c=0,d=(b.length-1)/2,e=a.ch;if(0==e)return b[2];for(;;){var f=c+d>>1;if((f?b[2*f-1]:0)>=e)d=f;else{if(!(b[2*f+1]<e))return b[2*f+2];c=f+1}}},getModeAt:function(a){var b=this.doc.mode;return b.innerMode?z.innerMode(b,this.getTokenAt(a).state).mode:b},getHelper:function(a,b){return this.getHelpers(a,b)[0]},getHelpers:function(a,b){var c=[];if(!md.hasOwnProperty(b))return md;var d=md[b],e=this.getModeAt(a);if("string"==typeof e[b])d[e[b]]&&c.push(d[e[b]]);else if(e[b])for(var f=0;f<e[b].length;f++){var g=d[e[b][f]];g&&c.push(g)}else e.helperType&&d[e.helperType]?c.push(d[e.helperType]):d[e.name]&&c.push(d[e.name]);for(var f=0;f<d._global.length;f++){var h=d._global[f];h.pred(e,this)&&-1==pf(c,h.val)&&c.push(h.val)}return c},getStateAfter:function(a,b){var c=this.doc;return a=Lc(c,null==a?c.first+c.size-1:a),hb(this,a+1,b)},cursorCoords:function(a,b){var c,d=this.doc.sel;return c=null==a?d.head:"object"==typeof a?Mc(this.doc,a):a?d.from:d.to,yb(this,c,b||"page")},charCoords:function(a,b){return xb(this,Mc(this.doc,a),b||"page")},coordsChar:function(a,b){return a=wb(this,a,b||"page"),Ab(this,a.left,a.top)},lineAtHeight:function(a,b){return a=wb(this,{top:a,left:0},b||"page").top,De(this.doc,a+this.display.viewOffset)},heightAtLine:function(a,b){var c=!1,d=this.doc.first+this.doc.size-1;a<this.doc.first?a=this.doc.first:a>d&&(a=d,c=!0);var e=ye(this.doc,a);return vb(this,ye(this.doc,a),{top:0,left:0},b||"page").top+(c?e.height:0)},defaultTextHeight:function(){return Db(this.display)},defaultCharWidth:function(){return Eb(this.display)},setGutterMarker:Ib(null,function(a,b,c){return _c(this,a,function(a){var d=a.gutterMarkers||(a.gutterMarkers={});return d[b]=c,!c&&wf(d)&&(a.gutterMarkers=null),!0})}),clearGutter:Ib(null,function(a){var b=this,c=b.doc,d=c.first;c.iter(function(c){c.gutterMarkers&&c.gutterMarkers[a]&&(c.gutterMarkers[a]=null,Lb(b,d,d+1),wf(c.gutterMarkers)&&(c.gutterMarkers=null)),++d})}),addLineClass:Ib(null,function(a,b,c){return _c(this,a,function(a){var d="text"==b?"textClass":"background"==b?"bgClass":"wrapClass";if(a[d]){if(new RegExp("(?:^|\\s)"+c+"(?:$|\\s)").test(a[d]))return!1;a[d]+=" "+c}else a[d]=c;return!0})}),removeLineClass:Ib(null,function(a,b,c){return _c(this,a,function(a){var d="text"==b?"textClass":"background"==b?"bgClass":"wrapClass",e=a[d];if(!e)return!1;if(null==c)a[d]=null;else{var f=e.match(new RegExp("(?:^|\\s+)"+c+"(?:$|\\s+)"));if(!f)return!1;var g=f.index+f[0].length;a[d]=e.slice(0,f.index)+(f.index&&g!=e.length?" ":"")+e.slice(g)||null}return!0})}),addLineWidget:Ib(null,function(a,b,c){return Zd(this,a,b,c)}),removeLineWidget:function(a){a.clear()},lineInfo:function(a){if("number"==typeof a){if(!Oc(this.doc,a))return null;var b=a;if(a=ye(this.doc,a),!a)return null}else{var b=Ce(a);if(null==b)return null}return{line:b,handle:a,text:a.text,gutterMarkers:a.gutterMarkers,textClass:a.textClass,bgClass:a.bgClass,wrapClass:a.wrapClass,widgets:a.widgets}},getViewport:function(){return{from:this.display.showingFrom,to:this.display.showingTo}},addWidget:function(a,b,c,d,e){var f=this.display;a=yb(this,Mc(this.doc,a));var g=a.bottom,h=a.left;if(b.style.position="absolute",f.sizer.appendChild(b),"over"==d)g=a.top;else if("above"==d||"near"==d){var i=Math.max(f.wrapper.clientHeight,this.doc.height),j=Math.max(f.sizer.clientWidth,f.lineSpace.clientWidth);("above"==d||a.bottom+b.offsetHeight>i)&&a.top>b.offsetHeight?g=a.top-b.offsetHeight:a.bottom+b.offsetHeight<=i&&(g=a.bottom),h+b.offsetWidth>j&&(h=j-b.offsetWidth)}b.style.top=g+"px",b.style.left=b.style.right="","right"==e?(h=f.sizer.clientWidth-b.offsetWidth,b.style.right="0px"):("left"==e?h=0:"middle"==e&&(h=(f.sizer.clientWidth-b.offsetWidth)/2),b.style.left=h+"px"),c&&Wc(this,h,g,h+b.offsetWidth,g+b.offsetHeight)},triggerOnKeyDown:Ib(null,pc),triggerOnKeyPress:Ib(null,qc),triggerOnKeyUp:Ib(null,nc),execCommand:function(a){return pd.hasOwnProperty(a)?pd[a](this):void 0},findPosH:function(a,b,c,d){var e=1;0>b&&(e=-1,b=-b);for(var f=0,g=Mc(this.doc,a);b>f&&(g=ad(this.doc,g,e,c,d),!g.hitSide);++f);return g},moveH:Ib(null,function(a,b){var d,c=this.doc.sel;d=c.shift||c.extend||Hc(c.from,c.to)?ad(this.doc,c.head,a,b,this.options.rtlMoveVisually):0>a?c.from:c.to,Pc(this.doc,d,d,a)}),deleteH:Ib(null,function(a,b){var c=this.doc.sel;Hc(c.from,c.to)?Fc(this.doc,"",c.from,ad(this.doc,c.head,a,b,!1),"+delete"):Fc(this.doc,"",c.from,c.to,"+delete"),this.curOp.userSelChange=!0}),findPosV:function(a,b,c,d){var e=1,f=d;0>b&&(e=-1,b=-b);for(var g=0,h=Mc(this.doc,a);b>g;++g){var i=yb(this,h,"div");if(null==f?f=i.left:i.left=f,h=bd(this,i,e,c),h.hitSide)break}return h},moveV:Ib(null,function(a,b){var d,e,c=this.doc.sel;if(c.shift||c.extend||Hc(c.from,c.to)){var f=yb(this,c.head,"div");null!=c.goalColumn&&(f.left=c.goalColumn),d=bd(this,f,a,b),"page"==b&&Zc(this,0,xb(this,d,"div").top-f.top),e=f.left}else d=0>a?c.from:c.to;Pc(this.doc,d,d,a),null!=e&&(c.goalColumn=e)}),toggleOverwrite:function(a){(null==a||a!=this.state.overwrite)&&((this.state.overwrite=!this.state.overwrite)?this.display.cursor.className+=" CodeMirror-overwrite":this.display.cursor.className=this.display.cursor.className.replace(" CodeMirror-overwrite",""),$e(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return document.activeElement==this.display.input},scrollTo:Ib(null,function(a,b){Yc(this,a,b)}),getScrollInfo:function(){var a=this.display.scroller,b=gf;return{left:a.scrollLeft,top:a.scrollTop,height:a.scrollHeight-b,width:a.scrollWidth-b,clientHeight:a.clientHeight-b,clientWidth:a.clientWidth-b}},scrollIntoView:Ib(null,function(a,b){null==a?a={from:this.doc.sel.head,to:null}:"number"==typeof a?a={from:Gc(a,0),to:null}:null==a.from&&(a={from:a,to:null}),a.to||(a.to=a.from),b||(b=0);var c=a;null!=a.from.line&&(this.curOp.scrollToPos={from:a.from,to:a.to,margin:b},c={from:yb(this,a.from),to:yb(this,a.to)});var d=Xc(this,Math.min(c.from.left,c.to.left),Math.min(c.from.top,c.to.top)-b,Math.max(c.from.right,c.to.right),Math.max(c.from.bottom,c.to.bottom)+b);Yc(this,d.scrollLeft,d.scrollTop)}),setSize:Ib(null,function(a,b){function c(a){return"number"==typeof a||/^\d+$/.test(String(a))?a+"px":a}null!=a&&(this.display.wrapper.style.width=c(a)),null!=b&&(this.display.wrapper.style.height=c(b)),this.options.lineWrapping&&(this.display.measureLineCache.length=this.display.measureLineCachePos=0),this.curOp.forceUpdate=!0,$e(this,"refresh",this)}),operation:function(a){return Kb(this,a)},refresh:Ib(null,function(){var a=this.display.cachedTextHeight;sb(this),Yc(this,this.doc.scrollLeft,this.doc.scrollTop),Lb(this),(null==a||Math.abs(a-Db(this.display))>.5)&&F(this),$e(this,"refresh",this)}),swapDoc:Ib(null,function(a){var b=this.doc;return b.cm=null,xe(this,a),sb(this),Pb(this,!0),Yc(this,a.scrollLeft,a.scrollTop),bf(this,"swapDoc",this,b),b}),getInputField:function(){return this.display.input},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},ff(z);var ed=z.optionHandlers={},fd=z.defaults={},hd=z.Init={toString:function(){return"CodeMirror.Init"}};gd("value","",function(a,b){a.setValue(b)},!0),gd("mode",null,function(a,b){a.doc.modeOption=b,B(a)},!0),gd("indentUnit",2,B,!0),gd("indentWithTabs",!1),gd("smartIndent",!0),gd("tabSize",4,function(a){C(a),sb(a),Lb(a)},!0),gd("specialChars",/[\t\u0000-\u0019\u00ad\u200b\u2028\u2029\ufeff]/g,function(a,b){a.options.specialChars=new RegExp(b.source+(b.test("	")?"":"|	"),"g"),a.refresh()},!0),gd("specialCharPlaceholder",je,function(a){a.refresh()},!0),gd("electricChars",!0),gd("rtlMoveVisually",!t),gd("wholeLineUpdateBefore",!0),gd("theme","default",function(a){H(a),I(a)},!0),gd("keyMap","default",G),gd("extraKeys",null),gd("onKeyEvent",null),gd("onDragEvent",null),gd("lineWrapping",!1,D,!0),gd("gutters",[],function(a){M(a.options),I(a)},!0),gd("fixedGutter",!0,function(a,b){a.display.gutters.style.left=b?S(a.display)+"px":"0",a.refresh()},!0),gd("coverGutterNextToScrollbar",!1,N,!0),gd("lineNumbers",!1,function(a){M(a.options),I(a)},!0),gd("firstLineNumber",1,I,!0),gd("lineNumberFormatter",function(a){return a},I,!0),gd("showCursorWhenSelecting",!1,ab,!0),gd("resetSelectionOnContextMenu",!0),gd("readOnly",!1,function(a,b){"nocursor"==b?(sc(a),a.display.input.blur(),a.display.disabled=!0):(a.display.disabled=!1,b||Pb(a,!0))}),gd("disableInput",!1,function(a,b){b||Pb(a,!0)},!0),gd("dragDrop",!0),gd("cursorBlinkRate",530),gd("cursorScrollMargin",0),gd("cursorHeight",1),gd("workTime",100),gd("workDelay",100),gd("flattenSpans",!0,C,!0),gd("addModeClass",!1,C,!0),gd("pollInterval",100),gd("undoDepth",40,function(a,b){a.doc.history.undoDepth=b}),gd("historyEventDelay",500),gd("viewportMargin",10,function(a){a.refresh()},!0),gd("maxHighlightLength",1e4,C,!0),gd("crudeMeasuringFrom",1e4),gd("moveInputWithCursor",!0,function(a,b){b||(a.display.inputDiv.style.top=a.display.inputDiv.style.left=0)}),gd("tabindex",null,function(a,b){a.display.input.tabIndex=b||""}),gd("autofocus",null);var id=z.modes={},jd=z.mimeModes={};z.defineMode=function(a,b){if(z.defaults.mode||"null"==a||(z.defaults.mode=a),arguments.length>2){b.dependencies=[];for(var c=2;c<arguments.length;++c)b.dependencies.push(arguments[c])}id[a]=b},z.defineMIME=function(a,b){jd[a]=b},z.resolveMode=function(a){if("string"==typeof a&&jd.hasOwnProperty(a))a=jd[a];else if(a&&"string"==typeof a.name&&jd.hasOwnProperty(a.name)){var b=jd[a.name];"string"==typeof b&&(b={name:b}),a=qf(b,a),a.name=b.name}else if("string"==typeof a&&/^[\w\-]+\/[\w\-]+\+xml$/.test(a))return z.resolveMode("application/xml");return"string"==typeof a?{name:a}:a||{name:"null"}},z.getMode=function(a,b){var b=z.resolveMode(b),c=id[b.name];if(!c)return z.getMode(a,"text/plain");var d=c(a,b);if(kd.hasOwnProperty(b.name)){var e=kd[b.name];for(var f in e)e.hasOwnProperty(f)&&(d.hasOwnProperty(f)&&(d["_"+f]=d[f]),d[f]=e[f])}if(d.name=b.name,b.helperType&&(d.helperType=b.helperType),b.modeProps)for(var f in b.modeProps)d[f]=b.modeProps[f];return d},z.defineMode("null",function(){return{token:function(a){a.skipToEnd()}}}),z.defineMIME("text/plain","null");var kd=z.modeExtensions={};z.extendMode=function(a,b){var c=kd.hasOwnProperty(a)?kd[a]:kd[a]={};rf(b,c)},z.defineExtension=function(a,b){z.prototype[a]=b},z.defineDocExtension=function(a,b){te.prototype[a]=b},z.defineOption=gd;var ld=[];z.defineInitHook=function(a){ld.push(a)};var md=z.helpers={};z.registerHelper=function(a,b,c){md.hasOwnProperty(a)||(md[a]=z[a]={_global:[]}),md[a][b]=c},z.registerGlobalHelper=function(a,b,c,d){z.registerHelper(a,b,d),md[a]._global.push({pred:c,val:d})},z.isWordChar=vf,z.copyState=nd,z.startState=od,z.innerMode=function(a,b){for(;a.innerMode;){var c=a.innerMode(b);if(!c||c.mode==a)break;b=c.state,a=c.mode}return c||{mode:a,state:b}};var pd=z.commands={selectAll:function(a){a.setSelection(Gc(a.firstLine(),0),Gc(a.lastLine()))},killLine:function(a){var b=a.getCursor(!0),c=a.getCursor(!1),d=!Hc(b,c);d||a.getLine(b.line).length!=b.ch?a.replaceRange("",b,d?c:Gc(b.line),"+delete"):a.replaceRange("",b,Gc(b.line+1,0),"+delete")},deleteLine:function(a){var b=a.getCursor().line;a.replaceRange("",Gc(b,0),Gc(b+1,0),"+delete")},delLineLeft:function(a){var b=a.getCursor();a.replaceRange("",Gc(b.line,0),b,"+delete")},undo:function(a){a.undo()},redo:function(a){a.redo()},goDocStart:function(a){a.extendSelection(Gc(a.firstLine(),0))},goDocEnd:function(a){a.extendSelection(Gc(a.lastLine()))},goLineStart:function(a){a.extendSelection(Tf(a,a.getCursor().line))},goLineStartSmart:function(a){var b=a.getCursor(),c=Tf(a,b.line),d=a.getLineHandle(c.line),e=Fe(d);if(e&&0!=e[0].level)a.extendSelection(c);else{var f=Math.max(0,d.text.search(/\S/)),g=b.line==c.line&&b.ch<=f&&b.ch;a.extendSelection(Gc(c.line,g?0:f))}},goLineEnd:function(a){a.extendSelection(Uf(a,a.getCursor().line))},goLineRight:function(a){var b=a.charCoords(a.getCursor(),"div").top+5;a.extendSelection(a.coordsChar({left:a.display.lineDiv.offsetWidth+100,top:b},"div"))},goLineLeft:function(a){var b=a.charCoords(a.getCursor(),"div").top+5;a.extendSelection(a.coordsChar({left:0,top:b},"div"))},goLineUp:function(a){a.moveV(-1,"line")},goLineDown:function(a){a.moveV(1,"line")},goPageUp:function(a){a.moveV(-1,"page")},goPageDown:function(a){a.moveV(1,"page")},goCharLeft:function(a){a.moveH(-1,"char")},goCharRight:function(a){a.moveH(1,"char")},goColumnLeft:function(a){a.moveH(-1,"column")},goColumnRight:function(a){a.moveH(1,"column")},goWordLeft:function(a){a.moveH(-1,"word")},goGroupRight:function(a){a.moveH(1,"group")},goGroupLeft:function(a){a.moveH(-1,"group")},goWordRight:function(a){a.moveH(1,"word")},delCharBefore:function(a){a.deleteH(-1,"char")},delCharAfter:function(a){a.deleteH(1,"char")},delWordBefore:function(a){a.deleteH(-1,"word")},delWordAfter:function(a){a.deleteH(1,"word")},delGroupBefore:function(a){a.deleteH(-1,"group")},delGroupAfter:function(a){a.deleteH(1,"group")},indentAuto:function(a){a.indentSelection("smart")},indentMore:function(a){a.indentSelection("add")},indentLess:function(a){a.indentSelection("subtract")},insertTab:function(a){a.replaceSelection("	","end","+input")},defaultTab:function(a){a.somethingSelected()?a.indentSelection("add"):a.replaceSelection("	","end","+input")},transposeChars:function(a){var b=a.getCursor(),c=a.getLine(b.line);b.ch>0&&b.ch<c.length-1&&a.replaceRange(c.charAt(b.ch)+c.charAt(b.ch-1),Gc(b.line,b.ch-1),Gc(b.line,b.ch+1))},newlineAndIndent:function(a){Ib(a,function(){a.replaceSelection("\n","end","+input"),a.indentLine(a.getCursor().line,null,!0)})()},toggleOverwrite:function(a){a.toggleOverwrite()}},qd=z.keyMap={};qd.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite"},qd.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-Up":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Down":"goDocEnd","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore",fallthrough:"basic"},qd.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineStart","Cmd-Right":"goLineEnd","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delLineLeft",fallthrough:["basic","emacsy"]},qd["default"]=s?qd.macDefault:qd.pcDefault,qd.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars"},z.lookupKey=sd,z.isModifierKey=td,z.keyName=ud,z.fromTextArea=function(a,b){function e(){a.value=i.getValue()}if(b||(b={}),b.value=a.value,!b.tabindex&&a.tabindex&&(b.tabindex=a.tabindex),!b.placeholder&&a.placeholder&&(b.placeholder=a.placeholder),null==b.autofocus){var c=document.body;try{c=document.activeElement}catch(d){}b.autofocus=c==a||null!=a.getAttribute("autofocus")&&c==document.body}if(a.form&&(Ye(a.form,"submit",e),!b.leaveSubmitMethodAlone)){var f=a.form,g=f.submit;try{var h=f.submit=function(){e(),f.submit=g,f.submit(),f.submit=h}}catch(d){}}a.style.display="none";var i=z(function(b){a.parentNode.insertBefore(b,a.nextSibling)},b);return i.save=e,i.getTextArea=function(){return a
-},i.toTextArea=function(){e(),a.parentNode.removeChild(i.getWrapperElement()),a.style.display="",a.form&&(Ze(a.form,"submit",e),"function"==typeof a.form.submit&&(a.form.submit=g))},i},vd.prototype={eol:function(){return this.pos>=this.string.length},sol:function(){return this.pos==this.lineStart},peek:function(){return this.string.charAt(this.pos)||void 0},next:function(){return this.pos<this.string.length?this.string.charAt(this.pos++):void 0},eat:function(a){var b=this.string.charAt(this.pos);if("string"==typeof a)var c=b==a;else var c=b&&(a.test?a.test(b):a(b));return c?(++this.pos,b):void 0},eatWhile:function(a){for(var b=this.pos;this.eat(a););return this.pos>b},eatSpace:function(){for(var a=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>a},skipToEnd:function(){this.pos=this.string.length},skipTo:function(a){var b=this.string.indexOf(a,this.pos);return b>-1?(this.pos=b,!0):void 0},backUp:function(a){this.pos-=a},column:function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=kf(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?kf(this.string,this.lineStart,this.tabSize):0)},indentation:function(){return kf(this.string,null,this.tabSize)-(this.lineStart?kf(this.string,this.lineStart,this.tabSize):0)},match:function(a,b,c){if("string"!=typeof a){var f=this.string.slice(this.pos).match(a);return f&&f.index>0?null:(f&&b!==!1&&(this.pos+=f[0].length),f)}var d=function(a){return c?a.toLowerCase():a},e=this.string.substr(this.pos,a.length);return d(e)==d(a)?(b!==!1&&(this.pos+=a.length),!0):void 0},current:function(){return this.string.slice(this.start,this.pos)},hideFirstChars:function(a,b){this.lineStart+=a;try{return b()}finally{this.lineStart-=a}}},z.StringStream=vd,z.TextMarker=wd,ff(wd),wd.prototype.clear=function(){if(!this.explicitlyCleared){var a=this.doc.cm,b=a&&!a.curOp;if(b&&Gb(a),ef(this,"clear")){var c=this.find();c&&bf(this,"clear",c.from,c.to)}for(var d=null,e=null,f=0;f<this.lines.length;++f){var g=this.lines[f],h=Bd(g.markedSpans,this);null!=h.to&&(e=Ce(g)),g.markedSpans=Cd(g.markedSpans,h),null!=h.from?d=Ce(g):this.collapsed&&!Sd(this.doc,g)&&a&&Be(g,Db(a.display))}if(a&&this.collapsed&&!a.options.lineWrapping)for(var f=0;f<this.lines.length;++f){var i=Rd(a.doc,this.lines[f]),j=K(a.doc,i);j>a.display.maxLineLength&&(a.display.maxLine=i,a.display.maxLineLength=j,a.display.maxLineChanged=!0)}null!=d&&a&&Lb(a,d,e+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,a&&Sc(a)),bf(a,