From cf2c56c7061b7ed40fdd3b40a352ddb9c9b7371f Mon Sep 17 00:00:00 2001 From: alexwl Date: Tue, 2 Oct 2018 13:17:04 +0300 Subject: Initial commit --- .gitignore | 12 + LICENSE | 19 + README.md | 116 + Setup.hs | 2 + app/Indexer.hs | 208 + app/Server.hs | 1014 ++ haskell-code-explorer.cabal | 137 + javascript/.ember-cli | 9 + javascript/.eslintrc.js | 15 + javascript/.gitignore | 15 + javascript/.watchmanconfig | 3 + javascript/README.md | 26 + javascript/app/app.js | 15 + javascript/app/components/.gitkeep | 0 javascript/app/components/bottom-panel.js | 52 + javascript/app/components/expression-info.js | 3 + javascript/app/components/file-tree.js | 94 + javascript/app/components/haskell-module.js | 492 + javascript/app/components/identifier-info.js | 62 + javascript/app/components/identifier-name.js | 60 + javascript/app/components/infinite-list.js | 50 + javascript/app/components/info-window.js | 144 + .../app/components/input-with-autocomplete.js | 131 + javascript/app/components/instance-info.js | 21 + javascript/app/components/paginated-list.js | 48 + javascript/app/components/resizable-panel.js | 72 + javascript/app/components/text-file.js | 67 + javascript/app/components/type-component.js | 29 + javascript/app/components/type-signature-text.js | 4 + javascript/app/components/type-signature.js | 23 + javascript/app/controllers/application.js | 21 + javascript/app/controllers/package.js | 24 + javascript/app/controllers/package/index.js | 14 + javascript/app/controllers/package/search.js | 15 + javascript/app/controllers/package/show/file.js | 9 + javascript/app/controllers/packages.js | 12 + javascript/app/helpers/.gitkeep | 0 javascript/app/index.html | 22 + javascript/app/router.js | 20 + javascript/app/routes/application.js | 3 + javascript/app/routes/package.js | 38 + javascript/app/routes/package/index.js | 7 + javascript/app/routes/package/search.js | 36 + javascript/app/routes/package/show/file.js | 27 + javascript/app/routes/package/show/index.js | 7 + javascript/app/routes/packages.js | 16 + javascript/app/services/settings.js | 21 + javascript/app/services/store.js | 141 + javascript/app/styles/app.scss | 555 + javascript/app/templates/application.hbs | 26 + javascript/app/templates/bad-url.hbs | 6 + javascript/app/templates/components/.gitkeep | 0 .../app/templates/components/bottom-panel.hbs | 9 + .../app/templates/components/expression-info.hbs | 8 + javascript/app/templates/components/file-tree.hbs | 8 + .../app/templates/components/haskell-module.hbs | 57 + .../app/templates/components/identifier-info.hbs | 39 + .../app/templates/components/identifier-name.hbs | 12 + .../app/templates/components/infinite-list.hbs | 3 + .../app/templates/components/info-window.hbs | 12 + .../components/input-with-autocomplete.hbs | 19 + .../app/templates/components/instance-info.hbs | 10 + .../app/templates/components/paginated-list.hbs | 17 + .../app/templates/components/resizable-panel.hbs | 5 + javascript/app/templates/components/text-file.hbs | 3 + .../app/templates/components/type-component.hbs | 3 + .../templates/components/type-signature-text.hbs | 2 + .../app/templates/components/type-signature.hbs | 10 + javascript/app/templates/package.hbs | 57 + javascript/app/templates/package/index.hbs | 12 + javascript/app/templates/package/search.hbs | 21 + javascript/app/templates/package/show.hbs | 1 + javascript/app/templates/package/show/file.hbs | 16 + javascript/app/templates/packages.hbs | 26 + javascript/app/utils/api-urls.js | 29 + javascript/app/utils/color-themes.js | 188 + javascript/app/utils/go-to-definition.js | 95 + javascript/app/utils/line-selection.js | 111 + javascript/bower.json | 6 + javascript/config/environment.js | 64 + javascript/config/targets.js | 9 + javascript/ember-cli-build.js | 21 + javascript/package.json | 53 + javascript/public/assets/32px.png | Bin 0 -> 1562 bytes javascript/public/assets/40px.png | Bin 0 -> 5717 bytes javascript/public/assets/favicon.ico | Bin 0 -> 1270 bytes javascript/public/assets/haskell.ico | Bin 0 -> 1270 bytes javascript/public/assets/throbber.gif | Bin 0 -> 1720 bytes javascript/public/robots.txt | 3 + .../32px-eebaf260766f5e0e773f53d3ea4f3e4d.png | Bin 0 -> 1562 bytes .../40px-51286e68b083696edaf4f9fc577e2a2d.png | Bin 0 -> 5717 bytes javascript/release/assets/favicon.ico | Bin 0 -> 1270 bytes ...de-explorer-132e5ea09a5eb8889a4b7fe11ee25e98.js | 204 + ...e-explorer-7473ab64643f48019c68ec4624ce37cb.css | 6 + javascript/release/assets/haskell.ico | Bin 0 -> 1270 bytes .../throbber-62be6ed2b189444b472b8000dc187240.gif | Bin 0 -> 1720 bytes .../vendor-1da6cdb46c95e61ce73ee429881d2b12.js | 5057 +++++++++ .../vendor-61c2b6995db771bb0e33f39a71767638.css | 3 + javascript/release/index.html | 25 + javascript/release/robots.txt | 3 + javascript/server/.eslintrc.js | 5 + javascript/server/index.js | 30 + javascript/server/mocks/packages.js | 397 + javascript/testem.js | 24 + javascript/tests/.eslintrc.js | 5 + javascript/tests/acceptance/haskell-module-test.js | 28 + javascript/tests/acceptance/package-test.js | 23 + javascript/tests/acceptance/packages-test.js | 16 + javascript/tests/helpers/.gitkeep | 0 javascript/tests/index.html | 33 + javascript/tests/integration/.gitkeep | 0 javascript/tests/integration/components/.gitkeep | 0 javascript/tests/test-helper.js | 8 + javascript/vendor/.gitkeep | 0 .../vendor/jquery-ui-1.12.1.custom/AUTHORS.txt | 333 + .../vendor/jquery-ui-1.12.1.custom/LICENSE.txt | 43 + .../external/jquery/jquery.js | 11008 +++++++++++++++++++ .../images/ui-icons_444444_256x240.png | Bin 0 -> 6992 bytes .../images/ui-icons_555555_256x240.png | Bin 0 -> 6988 bytes .../images/ui-icons_777620_256x240.png | Bin 0 -> 4549 bytes .../images/ui-icons_777777_256x240.png | Bin 0 -> 6999 bytes .../images/ui-icons_cc0000_256x240.png | Bin 0 -> 4549 bytes .../images/ui-icons_ffffff_256x240.png | Bin 0 -> 6299 bytes .../vendor/jquery-ui-1.12.1.custom/index.html | 325 + .../vendor/jquery-ui-1.12.1.custom/jquery-ui.css | 596 + .../vendor/jquery-ui-1.12.1.custom/jquery-ui.js | 3553 ++++++ .../jquery-ui-1.12.1.custom/jquery-ui.min.css | 7 + .../jquery-ui-1.12.1.custom/jquery-ui.min.js | 7 + .../jquery-ui.structure.css | 170 + .../jquery-ui.structure.min.css | 5 + .../jquery-ui-1.12.1.custom/jquery-ui.theme.css | 443 + .../jquery-ui.theme.min.css | 5 + .../vendor/jquery-ui-1.12.1.custom/package.json | 74 + src/HaskellCodeExplorer/AST/RenamedSource.hs | 498 + src/HaskellCodeExplorer/AST/TypecheckedSource.hs | 1231 +++ src/HaskellCodeExplorer/GhcUtils.hs | 1122 ++ src/HaskellCodeExplorer/ModuleInfo.hs | 811 ++ src/HaskellCodeExplorer/PackageInfo.hs | 595 + src/HaskellCodeExplorer/Preprocessor.hs | 159 + src/HaskellCodeExplorer/Types.hs | 880 ++ stack-8.0.2.yaml | 7 + stack-8.4.3.yaml | 9 + stack.yaml | 5 + test/Main.hs | 1211 ++ test/data/File.hs | 21 + test/data/File1.hs | 16 + test/data/File2.hs | 5 + test/data/File3.hs | 3 + test/data/FileAfterPreprocessor.hs | 31 + test/test-package/.gitignore | 12 + test/test-package/Setup.hs | 2 + test/test-package/app/Main.hs | 7 + test/test-package/src/Lib.hs | 13 + test/test-package/src/Types.hs | 5 + test/test-package/stack-8.0.2.yaml | 1 + test/test-package/stack.yaml | 1 + test/test-package/test-package.cabal | 33 + test/test-package/test/Spec.hs | 2 + 158 files changed, 34008 insertions(+) create mode 100644 .gitignore create mode 100644 LICENSE create mode 100644 README.md create mode 100644 Setup.hs create mode 100644 app/Indexer.hs create mode 100644 app/Server.hs create mode 100644 haskell-code-explorer.cabal create mode 100644 javascript/.ember-cli create mode 100644 javascript/.eslintrc.js create mode 100644 javascript/.gitignore create mode 100644 javascript/.watchmanconfig create mode 100644 javascript/README.md create mode 100644 javascript/app/app.js create mode 100644 javascript/app/components/.gitkeep create mode 100644 javascript/app/components/bottom-panel.js create mode 100644 javascript/app/components/expression-info.js create mode 100644 javascript/app/components/file-tree.js create mode 100644 javascript/app/components/haskell-module.js create mode 100644 javascript/app/components/identifier-info.js create mode 100644 javascript/app/components/identifier-name.js create mode 100644 javascript/app/components/infinite-list.js create mode 100644 javascript/app/components/info-window.js create mode 100644 javascript/app/components/input-with-autocomplete.js create mode 100644 javascript/app/components/instance-info.js create mode 100644 javascript/app/components/paginated-list.js create mode 100644 javascript/app/components/resizable-panel.js create mode 100644 javascript/app/components/text-file.js create mode 100644 javascript/app/components/type-component.js create mode 100644 javascript/app/components/type-signature-text.js create mode 100644 javascript/app/components/type-signature.js create mode 100644 javascript/app/controllers/application.js create mode 100644 javascript/app/controllers/package.js create mode 100644 javascript/app/controllers/package/index.js create mode 100644 javascript/app/controllers/package/search.js create mode 100644 javascript/app/controllers/package/show/file.js create mode 100644 javascript/app/controllers/packages.js create mode 100644 javascript/app/helpers/.gitkeep create mode 100644 javascript/app/index.html create mode 100644 javascript/app/router.js create mode 100644 javascript/app/routes/application.js create mode 100644 javascript/app/routes/package.js create mode 100644 javascript/app/routes/package/index.js create mode 100644 javascript/app/routes/package/search.js create mode 100644 javascript/app/routes/package/show/file.js create mode 100644 javascript/app/routes/package/show/index.js create mode 100644 javascript/app/routes/packages.js create mode 100644 javascript/app/services/settings.js create mode 100644 javascript/app/services/store.js create mode 100644 javascript/app/styles/app.scss create mode 100644 javascript/app/templates/application.hbs create mode 100644 javascript/app/templates/bad-url.hbs create mode 100644 javascript/app/templates/components/.gitkeep create mode 100644 javascript/app/templates/components/bottom-panel.hbs create mode 100644 javascript/app/templates/components/expression-info.hbs create mode 100644 javascript/app/templates/components/file-tree.hbs create mode 100644 javascript/app/templates/components/haskell-module.hbs create mode 100644 javascript/app/templates/components/identifier-info.hbs create mode 100644 javascript/app/templates/components/identifier-name.hbs create mode 100644 javascript/app/templates/components/infinite-list.hbs create mode 100644 javascript/app/templates/components/info-window.hbs create mode 100644 javascript/app/templates/components/input-with-autocomplete.hbs create mode 100644 javascript/app/templates/components/instance-info.hbs create mode 100644 javascript/app/templates/components/paginated-list.hbs create mode 100644 javascript/app/templates/components/resizable-panel.hbs create mode 100644 javascript/app/templates/components/text-file.hbs create mode 100644 javascript/app/templates/components/type-component.hbs create mode 100644 javascript/app/templates/components/type-signature-text.hbs create mode 100644 javascript/app/templates/components/type-signature.hbs create mode 100644 javascript/app/templates/package.hbs create mode 100644 javascript/app/templates/package/index.hbs create mode 100644 javascript/app/templates/package/search.hbs create mode 100644 javascript/app/templates/package/show.hbs create mode 100644 javascript/app/templates/package/show/file.hbs create mode 100644 javascript/app/templates/packages.hbs create mode 100644 javascript/app/utils/api-urls.js create mode 100644 javascript/app/utils/color-themes.js create mode 100644 javascript/app/utils/go-to-definition.js create mode 100644 javascript/app/utils/line-selection.js create mode 100644 javascript/bower.json create mode 100644 javascript/config/environment.js create mode 100644 javascript/config/targets.js create mode 100644 javascript/ember-cli-build.js create mode 100644 javascript/package.json create mode 100644 javascript/public/assets/32px.png create mode 100644 javascript/public/assets/40px.png create mode 100644 javascript/public/assets/favicon.ico create mode 100644 javascript/public/assets/haskell.ico create mode 100644 javascript/public/assets/throbber.gif create mode 100644 javascript/public/robots.txt create mode 100644 javascript/release/assets/32px-eebaf260766f5e0e773f53d3ea4f3e4d.png create mode 100644 javascript/release/assets/40px-51286e68b083696edaf4f9fc577e2a2d.png create mode 100644 javascript/release/assets/favicon.ico create mode 100644 javascript/release/assets/haskell-code-explorer-132e5ea09a5eb8889a4b7fe11ee25e98.js create mode 100644 javascript/release/assets/haskell-code-explorer-7473ab64643f48019c68ec4624ce37cb.css create mode 100644 javascript/release/assets/haskell.ico create mode 100644 javascript/release/assets/throbber-62be6ed2b189444b472b8000dc187240.gif create mode 100644 javascript/release/assets/vendor-1da6cdb46c95e61ce73ee429881d2b12.js create mode 100644 javascript/release/assets/vendor-61c2b6995db771bb0e33f39a71767638.css create mode 100644 javascript/release/index.html create mode 100644 javascript/release/robots.txt create mode 100644 javascript/server/.eslintrc.js create mode 100644 javascript/server/index.js create mode 100644 javascript/server/mocks/packages.js create mode 100644 javascript/testem.js create mode 100644 javascript/tests/.eslintrc.js create mode 100644 javascript/tests/acceptance/haskell-module-test.js create mode 100644 javascript/tests/acceptance/package-test.js create mode 100644 javascript/tests/acceptance/packages-test.js create mode 100644 javascript/tests/helpers/.gitkeep create mode 100644 javascript/tests/index.html create mode 100644 javascript/tests/integration/.gitkeep create mode 100644 javascript/tests/integration/components/.gitkeep create mode 100644 javascript/tests/test-helper.js create mode 100644 javascript/vendor/.gitkeep create mode 100644 javascript/vendor/jquery-ui-1.12.1.custom/AUTHORS.txt create mode 100644 javascript/vendor/jquery-ui-1.12.1.custom/LICENSE.txt create mode 100644 javascript/vendor/jquery-ui-1.12.1.custom/external/jquery/jquery.js create mode 100644 javascript/vendor/jquery-ui-1.12.1.custom/images/ui-icons_444444_256x240.png create mode 100644 javascript/vendor/jquery-ui-1.12.1.custom/images/ui-icons_555555_256x240.png create mode 100644 javascript/vendor/jquery-ui-1.12.1.custom/images/ui-icons_777620_256x240.png create mode 100644 javascript/vendor/jquery-ui-1.12.1.custom/images/ui-icons_777777_256x240.png create mode 100644 javascript/vendor/jquery-ui-1.12.1.custom/images/ui-icons_cc0000_256x240.png create mode 100644 javascript/vendor/jquery-ui-1.12.1.custom/images/ui-icons_ffffff_256x240.png create mode 100644 javascript/vendor/jquery-ui-1.12.1.custom/index.html create mode 100644 javascript/vendor/jquery-ui-1.12.1.custom/jquery-ui.css create mode 100644 javascript/vendor/jquery-ui-1.12.1.custom/jquery-ui.js create mode 100644 javascript/vendor/jquery-ui-1.12.1.custom/jquery-ui.min.css create mode 100644 javascript/vendor/jquery-ui-1.12.1.custom/jquery-ui.min.js create mode 100644 javascript/vendor/jquery-ui-1.12.1.custom/jquery-ui.structure.css create mode 100644 javascript/vendor/jquery-ui-1.12.1.custom/jquery-ui.structure.min.css create mode 100644 javascript/vendor/jquery-ui-1.12.1.custom/jquery-ui.theme.css create mode 100644 javascript/vendor/jquery-ui-1.12.1.custom/jquery-ui.theme.min.css create mode 100644 javascript/vendor/jquery-ui-1.12.1.custom/package.json create mode 100644 src/HaskellCodeExplorer/AST/RenamedSource.hs create mode 100644 src/HaskellCodeExplorer/AST/TypecheckedSource.hs create mode 100644 src/HaskellCodeExplorer/GhcUtils.hs create mode 100644 src/HaskellCodeExplorer/ModuleInfo.hs create mode 100644 src/HaskellCodeExplorer/PackageInfo.hs create mode 100644 src/HaskellCodeExplorer/Preprocessor.hs create mode 100644 src/HaskellCodeExplorer/Types.hs create mode 100644 stack-8.0.2.yaml create mode 100644 stack-8.4.3.yaml create mode 100644 stack.yaml create mode 100644 test/Main.hs create mode 100644 test/data/File.hs create mode 100644 test/data/File1.hs create mode 100644 test/data/File2.hs create mode 100644 test/data/File3.hs create mode 100644 test/data/FileAfterPreprocessor.hs create mode 100644 test/test-package/.gitignore create mode 100644 test/test-package/Setup.hs create mode 100644 test/test-package/app/Main.hs create mode 100644 test/test-package/src/Lib.hs create mode 100644 test/test-package/src/Types.hs create mode 100644 test/test-package/stack-8.0.2.yaml create mode 100644 test/test-package/stack.yaml create mode 100644 test/test-package/test-package.cabal create mode 100644 test/test-package/test/Spec.hs diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e03043b --- /dev/null +++ b/.gitignore @@ -0,0 +1,12 @@ +dist +dist-* +.stack-work/ +.haskell-code-explorer/ +.cabal-sandbox/ +cabal.sandbox.config +cabal.config +log/ +tmp/ +TAGS +\#*\# +.\#* diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..de9a72d --- /dev/null +++ b/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2018 Alexey Kiryushin + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..d55f554 --- /dev/null +++ b/README.md @@ -0,0 +1,116 @@ +# Haskell code explorer + +Haskell code explorer is a web application for exploring and understanding Haskell codebases. It provides IDE-like code intelligence features such as types and documentation on hover, "go to definition", "find references" and semantic highlighting. + +Examples : + +- [https://haskell-code-explorer.mfix.io/package/stm-2.4.5.0/show/Control/Concurrent/STM/TQueue.hs#L87](https://haskell-code-explorer.mfix.io/package/stm-2.4.5.0/show/Control/Concurrent/STM/TQueue.hs#L87) +- [https://haskell-code-explorer.mfix.io/package/async-2.1.1.1/show/Control/Concurrent/Async.hs#L251](https://haskell-code-explorer.mfix.io/package/async-2.1.1.1/show/Control/Concurrent/Async.hs#L251) +- [https://haskell-code-explorer.mfix.io/package/haxl-0.5.1.0/show/Haxl/Core/Monad.hs#L569](https://haskell-code-explorer.mfix.io/package/haxl-0.5.1.0/show/Haxl/Core/Monad.hs#L569) + +![Haskell code explorer](https://haskell-code-explorer.mfix.io/screenshot.png) + +Haskell code explorer consists of an indexer, an HTTP server, and a JavaScript application. The indexer uses GHC API to create a data structure that contains detailed information about the source code of a Cabal package. The HTTP server reads that data structure into memory and responds to HTTP requests from the JavaScript application. + +## Motivation + +Reading and understanding code is an essential part of the software development process. Understanding code in any statically typed language is much easier when code intelligence features (types on hover, go-to-definition, etc.) are available. Code intelligence for Haskell is especially useful because types are informative and precise (thanks to Haskell's purity and global type inference). + +## Features + +* Types (actual type, instantiated type, instance resolution tree) and documentation on hover. Types are interactive : left-click on type constructor -> go to definition, right click on type constructor -> show kind signature.
+ ![Hover](https://haskell-code-explorer.mfix.io/hover.png) + +* Go to definition + +* Find references + +* Type of each expression
+ ![Expression](https://haskell-code-explorer.mfix.io/expressions.png)
+ Select a piece of text to get the type of each Haskell expression inside the selection. + +* Semantic highlighting + +## Installation + +```bash +git clone https://github.com/alexwl/haskell-code-explorer +cd haskell-code-explorer +``` + +To build Haskell code explorer Stack ([https://docs.haskellstack.org/en/stable/README/](https://docs.haskellstack.org/en/stable/README/)) is needed. + +At the moment Haskell code explorer supports GHC 8.2.2 and 8.0.2. + +For GHC 8.2.2: + +```bash +stack install +``` + +For GHC 8.0.2: + +```bash +stack --stack-yaml=stack-8.0.2.yaml install +``` + + +## Indexing source code of a Cabal package + +`haskell-code-indexer` executable is responsible for indexing packages (by default index is saved to `.haskell-code-explorer` directory). + +`haskell-code-indexer` requires globally installed GHC and cabal-install (`cabal`). The reason for this is that `haskell-code-indexer` uses `cabal-helper` library [https://hackage.haskell.org/package/cabal-helper](https://hackage.haskell.org/package/cabal-helper) to get package build information. `cabal-helper` builds (at runtime) an executable linked against a version of Cabal library that was used to configure the package. + +If there is no globally installed GHC on the system, then it is possible to use `stack exec` command ([https://docs.haskellstack.org/en/stable/GUIDE/#exec](https://docs.haskellstack.org/en/stable/GUIDE/#exec)) that adds a path to GHC binaries installed by Stack to `PATH` environment variable : + +```bash +stack --resolver=lts-11.3 exec haskell-code-indexer -- INDEXER_OPTIONS +``` + +### Examples : + +Show all indexer options: +```bash +haskell-code-indexer -h +``` + +Index package : +```bash +haskell-code-indexer --package PATH +``` + +Index package with specific dist directory : +```bash +haskell-code-indexer --package PATH --dist dist-newstyle +``` + +Index package built by Stack : +```bash +haskell-code-indexer --package PATH --dist $(stack path --dist-dir) +``` + +## Starting HTTP Server + +`haskell-code-server` executable reads the package index created by `haskell-code-indexer` and starts the HTTP server. The HTTP server responds to API requests and serves static assets (JavaScript files that are in `haskell-code-explorer/javascript/release` directory). + +### Examples : + +Show all server options : + +```bash +haskell-code-server -h +``` + +Load the indexed package and start the server : + +```bash +haskell-code-server --package PATH --port 8080 --js-path haskell-code-explorer/javascript/release +``` + +Load multiple indexed packages and start the server : + +```bash +haskell-code-server --package PATH1 --package PATH2 --package PATH3 --port 8080 --js-path haskell-code-explorer/javascript/release +``` + +Open [http://localhost:8080](http://localhost:8080) in a browser to explore source code of the package. diff --git a/Setup.hs b/Setup.hs new file mode 100644 index 0000000..9a994af --- /dev/null +++ b/Setup.hs @@ -0,0 +1,2 @@ +import Distribution.Simple +main = defaultMain diff --git a/app/Indexer.hs b/app/Indexer.hs new file mode 100644 index 0000000..083c94d --- /dev/null +++ b/app/Indexer.hs @@ -0,0 +1,208 @@ +{-# LANGUAGE CPP #-} +{-# LANGUAGE DuplicateRecordFields #-} +{-# LANGUAGE ScopedTypeVariables #-} +{-# LANGUAGE OverloadedStrings #-} + +module Main where + +import Codec.Compression.GZip(compress) +import Control.Exception (SomeException, handle) +import Control.Monad (when) +import Control.Monad.Logger (LogLevel(..), runLoggingT) +import qualified Data.Aeson as A +import qualified Data.ByteString as BS +import qualified Data.ByteString.Lazy as BSL +import qualified Data.ByteString.Lazy.Char8 as BSC +import qualified Data.HashMap.Strict as HM +import Data.Maybe (fromMaybe) +import Data.Semigroup ((<>)) +import qualified Data.Serialize as S +import qualified Data.Text as T +import qualified Data.Text.Encoding as TE +import Data.Time (getZonedTime) +import Data.Version (Version(..),showVersion) +import HaskellCodeExplorer.PackageInfo (createPackageInfo) +import qualified HaskellCodeExplorer.Types as HCE +import Network.URI.Encode (encode) +import Options.Applicative + ( Parser + , (<|>) + , execParser + , flag + , fullDesc + , help + , helper + , info + , long + , many + , metavar + , optional + , progDesc + , short + , strOption + ) +import Paths_haskell_code_explorer as HSE (version) +import System.Directory (createDirectoryIfMissing) +import System.Exit (ExitCode(..), exitWith) +import System.FilePath (()) +import System.Log.FastLogger + ( LoggerSet + , ToLogStr(..) + , defaultBufSize + , fromLogStr + , newFileLoggerSet + , newStdoutLoggerSet + , pushLogStrLn + , rmLoggerSet + ) + +data IndexerConfig = IndexerConfig + { configPackageDirectoryPath :: FilePath + , configPackageDistDirRelativePath :: Maybe FilePath + , configOutputDirectoryName :: Maybe String + , configLog :: !HCE.Log + , configMinLogLevel :: !LogLevel + , configSourceCodePreprocessing :: !HCE.SourceCodePreprocessing + , configCompression :: !Compression + , configGhcOptions :: [String] + , configIgnoreDirectories :: [String] + } deriving (Show, Eq) + +data Compression + = Gzip + | NoCompression + deriving (Show, Eq) + +#if MIN_VERSION_GLASGOW_HASKELL(8,2,2,0) +ghcVersion :: Version +ghcVersion = Version {versionBranch = [8, 2, 2, 0], versionTags = []} +#else +ghcVersion :: Version +ghcVersion = Version {versionBranch = [8, 0, 2, 0], versionTags = []} +#endif + +versionInfo :: String +versionInfo = + "haskell-code-indexer version " ++ + showVersion version ++ ", GHC version " ++ showVersion ghcVersion + +main :: IO () +main = do + let description = + "haskell-code-indexer collects and saves information about the source code of a Cabal package. " ++ + versionInfo + config <- + execParser $ + info (helper <*> configParser) (fullDesc <> progDesc description) + loggerSet <- + case configLog config of + HCE.ToFile logfile -> newFileLoggerSet defaultBufSize logfile + HCE.StdOut -> newStdoutLoggerSet defaultBufSize + let minLogLevel = configMinLogLevel config + logger loggerSet minLogLevel LevelInfo versionInfo + logger loggerSet minLogLevel LevelDebug $ show config + handle + (\(e :: SomeException) -> do + logger loggerSet minLogLevel LevelError (show e) + rmLoggerSet loggerSet + exitWith (ExitFailure 1)) $ do + packageInfo <- + runLoggingT + (createPackageInfo + (configPackageDirectoryPath config) + (configPackageDistDirRelativePath config) + (configSourceCodePreprocessing config) + (configGhcOptions config) + (configIgnoreDirectories config)) + (\_loc _source level msg -> logger loggerSet minLogLevel level msg) + let outputDir = + configPackageDirectoryPath config + fromMaybe + HCE.defaultOutputDirectoryName + (configOutputDirectoryName config) + createDirectoryIfMissing False outputDir + logger loggerSet minLogLevel LevelDebug $ "Output directory : " ++ outputDir + BS.writeFile + (outputDir HCE.packageInfoBinaryFileName) + (S.encode $ HCE.toCompactPackageInfo packageInfo) + mapM_ + (\(HCE.HaskellModulePath path, modInfo) -> + let (compressFunction, compressExtension) = + case configCompression config of + Gzip -> (compress, ".gz") + NoCompression -> (id, "") + filePath = + outputDir + (encode (T.unpack path) ++ ".json" ++ compressExtension) + in BSL.writeFile filePath . compressFunction . A.encode $ modInfo) . + HM.toList $ + HCE.moduleMap (packageInfo :: HCE.PackageInfo HCE.ModuleInfo) + BSL.writeFile + (outputDir HCE.packageInfoJsonFileName) + (A.encode packageInfo) + BSL.writeFile (outputDir "version.txt") (BSC.pack $ showVersion version) + logger loggerSet minLogLevel LevelInfo ("Finished" :: T.Text) + rmLoggerSet loggerSet + +configParser :: Parser IndexerConfig +configParser = + IndexerConfig <$> + strOption + (long "package" <> short 'p' <> metavar "PATH" <> + help "Path to a Cabal package") <*> + optional + (strOption + (long "dist" <> metavar "RELATIVE_PATH" <> + help "Relative path to a dist directory")) <*> + optional + (strOption + (long "output" <> metavar "DIRECTORY_NAME" <> + help "Output directory (default is '.haskell-code-explorer')")) <*> + (pure HCE.StdOut <|> + (HCE.ToFile <$> + strOption + (long "logfile" <> metavar "PATH" <> + help "Path to a log file (by default log is written to stdout)"))) <*> + flag + LevelInfo + LevelDebug + (long "verbose" <> short 'v' <> help "Write debug information to a log") <*> + flag + HCE.AfterPreprocessing + HCE.BeforePreprocessing + (long "before-preprocessing" <> + help + "Index source code before preprocessor pass (by default source code after preprocessing is indexed)") <*> + flag + Gzip + NoCompression + (long "no-compression" <> + help + "Do not compress json files (by default json files are compressed using gzip)") <*> + many + (strOption + (long "ghc" <> metavar "OPTIONS" <> help "Command-line options for GHC")) <*> + many + (strOption + (long "ignore" <> metavar "DIRECTORY_NAME" <> + help "Directories to ignore (e.g. node_modules)")) + +logger :: ToLogStr msg => LoggerSet -> LogLevel -> LogLevel -> msg -> IO () +logger loggerSet minLogLevel logLevel msg = + when (logLevel >= minLogLevel) $ do + time <- getZonedTime + let showLogLevel :: LogLevel -> T.Text + showLogLevel LevelDebug = "[debug]" + showLogLevel LevelInfo = "[info]" + showLogLevel LevelWarn = "[warn]" + showLogLevel LevelError = "[error]" + showLogLevel (LevelOther t) = T.concat ["[",t,"]"] + text = + T.concat + [ T.pack $ show time + , " : " + , showLogLevel logLevel + , " " + , TE.decodeUtf8 . fromLogStr . toLogStr $ msg + ] + pushLogStrLn loggerSet $ toLogStr text diff --git a/app/Server.hs b/app/Server.hs new file mode 100644 index 0000000..39f550f --- /dev/null +++ b/app/Server.hs @@ -0,0 +1,1014 @@ +{-# LANGUAGE CPP #-} +{-# LANGUAGE FlexibleInstances #-} +{-# LANGUAGE FlexibleContexts #-} +{-# LANGUAGE ScopedTypeVariables #-} +{-# LANGUAGE RankNTypes #-} +{-# LANGUAGE RecordWildCards #-} +{-# LANGUAGE MultiParamTypeClasses #-} +{-# LANGUAGE DataKinds #-} +{-# LANGUAGE TypeOperators #-} +{-# LANGUAGE DuplicateRecordFields #-} +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE DeriveGeneric #-} +{-# LANGUAGE GeneralizedNewtypeDeriving #-} +{-# OPTIONS_GHC -fno-warn-orphans #-} + +module Main where + +import Control.Exception + ( SomeAsyncException + , SomeException + , fromException + , handle + , throwIO + , throwIO + , try + ) +import Control.Monad (unless) +import Control.Monad.Except (ExceptT(..)) +import Control.Monad.Reader (MonadIO, MonadReader, ReaderT(..), asks, liftIO) +import qualified Data.Aeson as A +import qualified Data.ByteString as BS +import qualified Data.Vector as V +import qualified Data.ByteString.Lazy as BSL +import Data.Default (def) +import Data.Either (lefts, rights) +import qualified Data.HashMap.Strict as HM +import Data.Hashable (Hashable) +import qualified Data.IntervalMap.Strict as IVM +import qualified Data.List as L +import qualified Data.Map.Strict as M +import Data.Maybe(fromMaybe) +#if MIN_VERSION_GLASGOW_HASKELL(8,4,3,0) +import qualified GHC.Compact as C +import Data.Functor.Identity(Identity(..)) +#endif +import Data.Pagination + ( Paginated + , hasNextPage + , hasPrevPage + , mkPagination + , paginate + , paginatedItems + , paginatedPagesTotal + ) +import Data.Proxy (Proxy(..)) +import Data.Semigroup ((<>)) +import qualified Data.Serialize as Serialize +import qualified Data.Set as S +import qualified Data.Text as T +import qualified Data.Text.Encoding as TE +import Data.Text.Lazy (toStrict) +import Data.Text.Read(decimal) +import Data.Version (Version(..)) +import GHC.Exts (Down(..), groupWith) +import GHC.Generics (Generic) +import qualified HaskellCodeExplorer.Types as HCE +import Network.HTTP.Types + ( hContentEncoding + , hContentType + , status200 + , status404 + ) +import Network.Mime (defaultMimeLookup) +import Network.Wai + ( Application + , Middleware + , Response + , pathInfo + , responseFile + , responseLBS + , requestHeaders + ) +import Network.Wai.Handler.Warp (run) +import Network.Wai.Middleware.RequestLogger + ( Destination(..) + , OutputFormat(..) + , RequestLoggerSettings(..) + , mkRequestLogger + ) +import Numeric.Natural(Natural) +import Options.Applicative + ( Parser + , (<**>) + , (<|>) + , auto + , execParser + , fullDesc + , help + , helper + , info + , long + , some + , metavar + , option + , optional + , progDesc + , short + , strOption + , switch + ) +import Servant + ( (:<|>)(..) + , (:>) + , Capture + , FromHttpApiData(..) + , Get + , Header + , Headers + , QueryParam + , ServantErr + , ServerT + , ToHttpApiData(..) + , addHeader + , err404 + , errBody + , serve + ) +import Servant.API.ContentTypes (AllCTRender(..), JSON) +import Servant.Server (Handler(..), hoistServer) +import Servant.Utils.Links (safeLink) +import System.Directory (doesFileExist) +import System.FilePath.Find + ( FileType(..) + , (&&?) + , (/=?) + , (==?) + , (==?) + , depth + , filePath + , fileType + , find + ) +import System.FilePath.Posix ((),takeFileName) +import System.Log.FastLogger + ( LoggerSet + , defaultBufSize + , newFileLoggerSet + , newStdoutLoggerSet + ) +import Text.Blaze.Html.Renderer.Text (renderHtml) +import qualified Text.Blaze.Html5 as Html hiding (html, source) + +-------------------------------------------------------------------------------- +-- Server config +-------------------------------------------------------------------------------- + +data ServerConfig = ServerConfig + { configPackagesPath :: !PackagesPath + , configPort :: !Int + , configServeStaticFiles :: !Bool + , configEnableExpressionInfo :: !Bool + , configIndexDirectoryName :: !(Maybe FilePath) + , configLog :: !HCE.Log + , configStaticFilesUrlPrefix :: !String + , configJsDistDirectory :: !(Maybe String) + , configMaxPerPage :: !Int + } deriving (Show, Eq) + +data PackagesPath + = DirectoryWithPackages FilePath + | Directories [FilePath] + deriving (Show, Eq) + +configParser :: Parser ServerConfig +configParser = + ServerConfig <$> + ((DirectoryWithPackages <$> + strOption + (long "packages" <> metavar "PATH" <> + help "Path to a directory with Cabal packages")) <|> + Directories <$> + some + (strOption + (long "package" <> short 'p' <> metavar "PATH" <> + help "Path to a Cabal package"))) <*> + (pure 8080 <|> + option + auto + (long "port" <> help "Port to use (default is 8080)" <> metavar "PORT")) <*> + (not <$> switch (long "no-static" <> help "Do not serve static files")) <*> + (not <$> + switch + (long "no-expressions" <> + help "Disable queries that return expressions inside selected span")) <*> + optional + (strOption + (long "index-directory" <> + help + "Name of a directory with index (default is '.haskell-code-explorer')" <> + metavar "DIRECTORY_NAME")) <*> + (pure HCE.StdOut <|> + (HCE.ToFile <$> + strOption + (long "logfile" <> + help "Path to a log file (by default log is written to stdout)" <> + metavar "PATH"))) <*> + (pure "files" <|> + strOption + (long "static-url-prefix" <> metavar "STRING" <> + help "URL prefix for static files (default is 'files')")) <*> + optional + (strOption + (long "js-path" <> help "Path to a directory with javascript files" <> + metavar "PATH")) <*> + (pure 50 <|> + option + auto + (long "max-per-page" <> metavar "INTEGER" <> + help "Maximum number of items per page (default is 50)")) + +-------------------------------------------------------------------------------- +-- Loading packages +-------------------------------------------------------------------------------- + +data PackageVersions = PackageVersions + { name :: T.Text + , versions :: [Version] + } deriving (Show, Ord, Eq, Generic) + +type PackageMap + = HM.HashMap PackageName (M.Map Version (HCE.PackageInfo HCE.CompactModuleInfo)) + +type PackagePathMap = HM.HashMap PackageId FilePath + +newtype AllPackages = + AllPackages BSL.ByteString + +newtype PackageId = PackageId + { getPackageId :: T.Text + } deriving (Show, Eq, Hashable) + +newtype PackageName = PackageName + { getPackageName :: T.Text + } deriving (Show, Eq, Hashable) + +instance A.ToJSON PackageVersions + +loadPackages :: + ServerConfig -> IO (Maybe (PackageMap, PackagePathMap, [PackageVersions])) +loadPackages config = do + packageDirectories <- + case configPackagesPath config of + DirectoryWithPackages dir -> + find (depth ==? 0) (fileType ==? Directory &&? filePath /=? dir) dir + Directories dirs -> return dirs + result <- mapM (loadPackageInfo config) packageDirectories + let loadedPackages = rights result + packageLoadErrors = lefts result + packageInfos = map fst loadedPackages + packageIds = + map (HCE.id :: HCE.PackageInfo modInfo -> HCE.PackageId) packageInfos + unless (null packageInfos) $ do + putStrLn "Loaded packages : " + mapM_ (print . HCE.packageIdToText) packageIds + unless (null packageLoadErrors) $ do + putStrLn "Package loading errors : " + mapM_ (\(err, path) -> putStrLn $ path ++ " : " ++ err) packageLoadErrors + if not . null $ loadedPackages + then do + let packageVersions = + L.sortOn (T.toLower . (name :: PackageVersions -> T.Text)) . + map + (\(name, versions) -> + PackageVersions name (L.sortOn Down versions)) . + HM.toList . + HM.fromListWith (++) . + map (\HCE.PackageId {..} -> (name, [version])) $ + packageIds + packageMap = + L.foldl' + (\hMap packageInfo -> + let val = M.singleton (packageVersion packageInfo) packageInfo + in HM.insertWith M.union (packageName packageInfo) val hMap) + HM.empty + packageInfos + packagePathMap = + L.foldl' + (\hMap (packageInfo, path) -> + let key = + PackageId $ + HCE.packageIdToText + (HCE.id + (packageInfo :: HCE.PackageInfo HCE.CompactModuleInfo)) + in HM.insert key path hMap) + HM.empty + loadedPackages + packageMapCompacted <- ghcCompact packageMap + packagePathMapCompacted <- ghcCompact packagePathMap + packageVersionsCompacted <- ghcCompact packageVersions + return . Just $ + (packageMapCompacted, packagePathMapCompacted, packageVersionsCompacted) + else return Nothing + where + packageName :: HCE.PackageInfo HCE.CompactModuleInfo -> PackageName + packageName = + PackageName . + (HCE.name :: HCE.PackageId -> T.Text) . + (HCE.id :: HCE.PackageInfo modInfo -> HCE.PackageId) + packageVersion :: HCE.PackageInfo HCE.CompactModuleInfo -> Version + packageVersion = + HCE.version . (HCE.id :: HCE.PackageInfo modInfo -> HCE.PackageId) + +ghcCompact :: forall a. a -> IO a +ghcCompact = +#if MIN_VERSION_GLASGOW_HASKELL(8,4,3,0) + (fmap C.getCompact . C.compact) +#else + return +#endif + +loadPackageInfo :: + ServerConfig + -> String + -> IO (Either (String, FilePath) ( HCE.PackageInfo HCE.CompactModuleInfo + , FilePath)) +loadPackageInfo config path = + handleSync (\e -> return $ Left (show e, path)) $ do + let indexDirectory = + fromMaybe + HCE.defaultOutputDirectoryName + (configIndexDirectoryName config) + binaryContent <- + BS.readFile (path indexDirectory HCE.packageInfoBinaryFileName) + let eitherPackageInfo = Serialize.decode binaryContent + enableExpressionInfo = configEnableExpressionInfo config + case eitherPackageInfo of + Right packageInfo -> + return . Right $ + ( updateEachModuleInfo + packageInfo + (\modInfo -> + let source = + HCE.source :: HCE.CompactModuleInfo -> V.Vector T.Text + in if not enableExpressionInfo + then modInfo + { HCE.exprInfoMap = IVM.empty + } + else modInfo) + , path) + Left e -> return . Left $ (e, path) + +updateEachModuleInfo :: + HCE.PackageInfo HCE.CompactModuleInfo + -> (HCE.CompactModuleInfo -> HCE.CompactModuleInfo) + -> HCE.PackageInfo HCE.CompactModuleInfo +updateEachModuleInfo packageInfo update = + packageInfo {HCE.moduleMap = HM.map update $ HCE.moduleMap packageInfo} + +handleSync :: (SomeException -> IO a) -> IO a -> IO a +handleSync onError = + handle + (\ex -> + case fromException ex of + Just (asyncEx :: SomeAsyncException) -> throwIO asyncEx + _ -> onError ex) + +-------------------------------------------------------------------------------- +-- Servant API +-------------------------------------------------------------------------------- + +type API = GetAllPackages + :<|> GetDefinitionSite + :<|> GetExpressions + :<|> GetReferences + :<|> GetIdentifiers + +type GetAllPackages = "api" :> "packages" :> Get '[JSON] AllPackages + +type GetDefinitionSite = "api" :> "definitionSite" + :> Capture "packageId" PackageId + :> Capture "componentId" HCE.ComponentId + :> Capture "moduleName" HCE.HaskellModuleName + :> Capture "entity" HCE.LocatableEntity + :> Capture "name" T.Text + :> Get '[JSON] HCE.DefinitionSite + +type GetExpressions = "api" :> "expressions" + :> Capture "packageId" PackageId + :> Capture "modulePath" HCE.HaskellModulePath + :> Capture "lineStart" Int + :> Capture "columnStart" Int + :> Capture "lineEnd" Int + :> Capture "columnEnd" Int + :> Get '[JSON] [Expression] + +type GetReferences = "api" :> "references" + :> Capture "packageId" PackageId + :> Capture "name" HCE.ExternalId + :> QueryParam "page" Int + :> QueryParam "per_page" Int + :> Get '[JSON] (Headers '[Header "Link" T.Text,Header "X-Total-Count" Int] + [SourceFile]) + +type GetIdentifiers = "api" :> "identifiers" + :> Capture "packageId" PackageId + :> Capture "query" T.Text + :> QueryParam "page" Int + :> QueryParam "per_page" Int + :> Get '[JSON] (Headers '[Header "Link" T.Text,Header "X-Total-Count" Int] + [HCE.ExternalIdentifierInfo]) + +instance AllCTRender '[ JSON] AllPackages where + handleAcceptH _ _ (AllPackages bytestring) = + Just ("application/json", bytestring) + +instance FromHttpApiData HCE.LocatableEntity where + parseQueryParam "Val" = Right HCE.Val + parseQueryParam "Typ" = Right HCE.Typ + parseQueryParam "Inst" = Right HCE.Inst + parseQueryParam "Mod" = Right HCE.Mod + parseQueryParam val = Left $ T.append "Incorrect LocatableEntity : " val + +instance ToHttpApiData HCE.LocatableEntity where + toUrlPiece HCE.Val = "ValueEntity" + toUrlPiece HCE.Typ = "TypeEntity" + toUrlPiece HCE.Inst = "InstanceEntity" + toUrlPiece HCE.Mod = "ModuleEntity" + +instance ToHttpApiData HCE.ExternalId where + toUrlPiece (HCE.ExternalId i) = i + +instance ToHttpApiData PackageId where + toUrlPiece (PackageId p) = p + +instance FromHttpApiData HCE.HaskellModulePath where + parseQueryParam = Right . HCE.HaskellModulePath + +instance FromHttpApiData HCE.ComponentId where + parseQueryParam = Right . HCE.ComponentId + +instance FromHttpApiData HCE.HaskellModuleName where + parseQueryParam = Right . HCE.HaskellModuleName + +instance FromHttpApiData HCE.ExternalId where + parseQueryParam = Right . HCE.ExternalId + +instance FromHttpApiData PackageId where + parseQueryParam = Right . PackageId + +-------------------------------------------------------------------------------- +-- Request handlers +-------------------------------------------------------------------------------- + +data Environment = Environment + { envLogger :: !LoggerSet + , envPackageMap :: !PackageMap + , envPackageVersions :: !AllPackages + , envConfig :: !ServerConfig + } + +data Expression = Expression + { srcSpan :: !(IVM.Interval (Int, Int)) + , info :: !HCE.ExpressionInfo + } deriving (Show, Eq, Generic) + +instance A.ToJSON Expression + +data ReferenceWithSource = ReferenceWithSource + { sourceCodeHtml :: !T.Text + , idSrcSpan :: !HCE.IdentifierSrcSpan + } deriving (Show, Eq, Generic) + +data SourceFile = SourceFile + { name :: !T.Text + , references :: ![ReferenceWithSource] + } deriving (Show, Eq, Generic) + +instance A.ToJSON ReferenceWithSource +instance A.ToJSON SourceFile + +getAllPackages :: ReaderT Environment IO AllPackages +getAllPackages = asks envPackageVersions + +getPackageInfoAndModulePath :: + PackageId + -> HCE.ComponentId + -> HCE.HaskellModuleName + -> ReaderT Environment IO ( HCE.PackageInfo HCE.CompactModuleInfo + , HCE.HaskellModulePath) +getPackageInfoAndModulePath packageId componentId moduleName = + withPackageInfo packageId $ \packageInfo -> + case HM.lookup moduleName (HCE.moduleNameMap packageInfo) of + Just modulePathMap -> + case HM.lookup componentId modulePathMap of + Just path -> return (packageInfo, path) + Nothing -> + error404 $ + BSL.concat + [ "Module " + , toLazyBS $ HCE.getHaskellModuleName moduleName + , " not found in component " + , toLazyBS $ HCE.getComponentId componentId + ] + Nothing -> + error404 $ + BSL.concat + [ "Module " + , toLazyBS $ HCE.getHaskellModuleName moduleName + , " not found in package " + , toLazyBS $ getPackageId packageId + ] + +getExpressions :: + PackageId + -> HCE.HaskellModulePath + -> Int -- ^ Start line + -> Int -- ^ Start column + -> Int -- ^ End line + -> Int -- ^ End column + -> ReaderT Environment IO [Expression] +getExpressions packageId modulePath startLine startColumn endLine endColumn = do + enableExpressionInfo <- asks (configEnableExpressionInfo . envConfig) + if not enableExpressionInfo + then error404 "Expression queries are disabled" + else withPackageInfo packageId $ \packageInfo -> + withModuleInfo packageInfo modulePath $ \modInfo -> do + maxPerPage <- asks (configMaxPerPage . envConfig) + let exprInfoMap = + HCE.exprInfoMap (modInfo :: HCE.CompactModuleInfo) + requestedInterval = + IVM.ClosedInterval + (startLine, startColumn) + (endLine, endColumn) + return . + map (uncurry Expression) . + L.take maxPerPage . IVM.toList . IVM.within exprInfoMap $ + requestedInterval + +getDefinitionSite :: + PackageId + -> HCE.ComponentId + -> HCE.HaskellModuleName + -> HCE.LocatableEntity + -> T.Text + -> ReaderT Environment IO HCE.DefinitionSite +getDefinitionSite packageId componentId modName entity name = + withPackageInfo packageId $ \packageInfo -> + withModulePath packageInfo componentId modName $ \modPath -> + case entity of + HCE.Mod -> + return $ + HCE.DefinitionSite + (HCE.ExactLocation + (HCE.id (packageInfo :: HCE.PackageInfo HCE.CompactModuleInfo)) + modPath + modName + 1 + 1 + 1 + 1) + Nothing + _ -> + withModuleInfo packageInfo modPath $ \modInfo -> do + let defSites = + HCE.definitionSiteMap (modInfo :: HCE.CompactModuleInfo) + mbDefinitionSite = + case entity of + HCE.Typ -> + HM.lookup (HCE.OccName name) $ + HCE.types (defSites :: HCE.DefinitionSiteMap) + HCE.Val -> + HM.lookup (HCE.OccName name) $ + HCE.values (defSites :: HCE.DefinitionSiteMap) + HCE.Inst -> + HM.lookup name $ + HCE.instances (defSites :: HCE.DefinitionSiteMap) + _ -> Nothing + case mbDefinitionSite of + Just definitionSite -> return definitionSite + Nothing -> + error404 $ + BSL.concat + [ toLazyBS . T.pack $ show entity + , " " + , toLazyBS name + , " " + , " not found in a module " + , toLazyBS $ HCE.getHaskellModulePath modPath + ] + +buildLinkHeader :: T.Text -> Paginated a -> Natural -> Natural -> T.Text +buildLinkHeader url paginated currentPage perPage = + T.intercalate + "," + (let addFirst + | currentPage /= 1 = + (:) (link (T.append url $ params 1 perPage) "first") + | otherwise = id + addLast + | currentPage /= paginatedPagesTotal paginated = + (:) + (link + (T.append url $ params (paginatedPagesTotal paginated) perPage) + "last") + | otherwise = id + addNext + | hasNextPage paginated = + (:) (link (T.append url $ params (currentPage + 1) perPage) "next") + | otherwise = id + addPrev + | hasPrevPage paginated = + (:) (link (T.append url $ params (currentPage - 1) perPage) "prev") + | otherwise = id + in addFirst . addLast . addNext . addPrev $ []) + where + link :: T.Text -> T.Text -> T.Text + link u rel = T.concat ["<", u, ">; rel=\"", rel, "\""] + params :: Natural -> Natural -> T.Text + params p pp = + T.concat ["?page=", T.pack . show $ p, "&per_page=", T.pack . show $ pp] + +initializePagination :: + (MonadReader Environment m) + => Maybe Int + -> Maybe Int + -> m (Natural, Natural) +initializePagination mbPage mbPerPage = do + maxPerPage <- asks (configMaxPerPage . envConfig) + let page = + case mbPage of + Just p -> + if p > 0 + then p + else 1 + Nothing -> 1 + perPage = + case mbPerPage of + Just pp -> + if pp <= maxPerPage && pp > 0 + then pp + else maxPerPage + Nothing -> maxPerPage + return (fromIntegral page, fromIntegral perPage) + +getReferences :: + PackageId + -> HCE.ExternalId + -> Maybe Int -- ^ Page number + -> Maybe Int -- ^ Items per page + -> ReaderT Environment IO (Headers '[ Header "Link" T.Text, Header "X-Total-Count" Int] [SourceFile]) +getReferences packageId externalId mbPage mbPerPage = + withPackageInfo packageId $ \packageInfo -> + case S.toList <$> HM.lookup externalId (HCE.externalIdOccMap packageInfo) of + Just references -> do + (page, perPage) <- initializePagination mbPage mbPerPage + pagination <- mkPagination perPage page + let totalCount = L.length references + paginatedReferences <- + paginate + pagination + (fromIntegral totalCount) + (\offset limit -> return . L.take limit . L.drop offset $ references) + let url = + T.append "/" $ + toUrlPiece $ + safeLink + (Proxy :: Proxy API) + (Proxy :: Proxy GetReferences) + packageId + externalId + Nothing + Nothing + linkHeader = buildLinkHeader url paginatedReferences page perPage + addHeaders :: + forall a. + a + -> Headers '[ Header "Link" T.Text, Header "X-Total-Count" Int] a + addHeaders = addHeader linkHeader . addHeader totalCount + refModulePath :: ReferenceWithSource -> HCE.HaskellModulePath + refModulePath = + (HCE.modulePath :: HCE.IdentifierSrcSpan -> HCE.HaskellModulePath) . + idSrcSpan + return $ + addHeaders $ + concatMap + (\refs -> + case refs of + ref:_ -> + let path = + HCE.getHaskellModulePath . + (HCE.modulePath :: HCE.IdentifierSrcSpan -> HCE.HaskellModulePath) . + idSrcSpan $ + ref + in [SourceFile path refs] + _ -> []) $ + groupWith refModulePath $ + map + (mkReferenceWithSource packageInfo) + (paginatedItems paginatedReferences) + Nothing -> + error404 $ + BSL.concat + [ "Cannot find references to " + , toLazyBS $ HCE.getExternalId externalId + ] + +mkReferenceWithSource :: + HCE.PackageInfo HCE.CompactModuleInfo + -> HCE.IdentifierSrcSpan + -> ReferenceWithSource +mkReferenceWithSource packageInfo idSrcSpan = + let mbModule = + HM.lookup + (HCE.modulePath (idSrcSpan :: HCE.IdentifierSrcSpan)) + (HCE.moduleMap (packageInfo :: HCE.PackageInfo HCE.CompactModuleInfo)) + in case mbModule of + Just modInfo -> + let sourceCodeHtml = + buildHtmlCodeSnippet + (HCE.source (modInfo :: HCE.CompactModuleInfo)) + (HCE.line (idSrcSpan :: HCE.IdentifierSrcSpan)) + (HCE.startColumn (idSrcSpan :: HCE.IdentifierSrcSpan)) + (HCE.endColumn (idSrcSpan :: HCE.IdentifierSrcSpan)) + in ReferenceWithSource sourceCodeHtml idSrcSpan + _ -> ReferenceWithSource "" idSrcSpan + +buildHtmlCodeSnippet :: V.Vector T.Text -> Int -> Int -> Int -> T.Text +buildHtmlCodeSnippet sourceLines lineNumber startColumn endColumn = + toStrict $ + renderHtml $ do + mkLineNumber (lineNumber - 1) >> + Html.toHtml + (T.append (fromMaybe "" $ (V.!?) sourceLines (lineNumber - 2)) "\n") + mkLineNumber lineNumber >> + highlightIdentifier + (T.append (fromMaybe "" $ (V.!?) sourceLines (lineNumber - 1)) "\n") + mkLineNumber (lineNumber + 1) >> + Html.toHtml (T.append (fromMaybe "" $ (V.!?) sourceLines lineNumber) "\n") + where + mkLineNumber :: Int -> Html.Html + mkLineNumber i = Html.toHtml (show i ++ " ") + highlightIdentifier :: T.Text -> Html.Html + highlightIdentifier line = + let (startLine, remaining) = T.splitAt (startColumn - 1) line + (identifier, endLine) = T.splitAt (endColumn - startColumn) remaining + in Html.toHtml startLine >> Html.b (Html.toHtml identifier) >> + Html.toHtml endLine + +findIdentifiers :: + PackageId + -> T.Text + -> Maybe Int + -> Maybe Int + -> ReaderT Environment IO (Headers '[ Header "Link" T.Text, Header "X-Total-Count" Int] + [HCE.ExternalIdentifierInfo]) +findIdentifiers packageId query mbPage mbPerPage = + withPackageInfo packageId $ \packageInfo -> do + let identifiers + | not $ T.null query = + S.toList $ + HCE.match (T.unpack query) (HCE.externalIdInfoMap packageInfo) + | otherwise = [] + (page, perPage) <- initializePagination mbPage mbPerPage + let totalCount = L.length identifiers + pagination <- mkPagination perPage page + paginatedIdentifiers <- + paginate + pagination + (fromIntegral totalCount) + (\offset limit -> return . L.take limit . L.drop offset $ identifiers) + let url = + T.append "/" $ + toUrlPiece $ + safeLink + (Proxy :: Proxy API) + (Proxy :: Proxy GetIdentifiers) + packageId + query + Nothing + Nothing + linkHeader = buildLinkHeader url paginatedIdentifiers page perPage + addHeaders :: + forall a. + a + -> Headers '[ Header "Link" T.Text, Header "X-Total-Count" Int] a + addHeaders = addHeader linkHeader . addHeader totalCount + return . addHeaders . paginatedItems $ paginatedIdentifiers + +error404 :: BSL.ByteString -> ReaderT Environment IO a +error404 body = throwServantError $ err404 {errBody = body} + +toLazyBS :: T.Text -> BSL.ByteString +toLazyBS = BSL.fromStrict . TE.encodeUtf8 + +withPackageInfo :: + PackageId + -> (HCE.PackageInfo HCE.CompactModuleInfo -> ReaderT Environment IO a) + -> ReaderT Environment IO a +withPackageInfo packageId action + | Just (packageName, mbVersion) <- parsePackageId packageId = do + packageMap <- asks envPackageMap + let mbPackageInfo = + HM.lookup packageName packageMap >>= + (\packages -> + let findLastVersion :: M.Map k v -> Maybe v + findLastVersion = fmap (snd . fst) . L.uncons . M.toDescList + in case mbVersion of + Just version -> + M.lookup version packages <|> findLastVersion packages + Nothing -> findLastVersion packages) + case mbPackageInfo of + Just p -> action p + Nothing -> packageNotFound packageId +withPackageInfo packageId _ = packageNotFound packageId + +packageNotFound :: PackageId -> ReaderT Environment IO a +packageNotFound packageId = + error404 $ + BSL.concat ["Package ", toLazyBS $ getPackageId packageId, " is not found."] + +withModuleInfo :: + HCE.PackageInfo HCE.CompactModuleInfo + -> HCE.HaskellModulePath + -> (HCE.CompactModuleInfo -> ReaderT Environment IO a) + -> ReaderT Environment IO a +withModuleInfo packageInfo path action = + case HM.lookup + path + (HCE.moduleMap (packageInfo :: HCE.PackageInfo HCE.CompactModuleInfo)) of + Just modInfo -> action modInfo + Nothing -> + error404 $ + BSL.concat + [ "Module " + , toLazyBS $ HCE.getHaskellModulePath path + , " is not found in package " + , toLazyBS $ + HCE.packageIdToText $ + HCE.id (packageInfo :: HCE.PackageInfo HCE.CompactModuleInfo) + ] + +withModulePath :: + HCE.PackageInfo HCE.CompactModuleInfo + -> HCE.ComponentId + -> HCE.HaskellModuleName + -> (HCE.HaskellModulePath -> ReaderT Environment IO a) + -> ReaderT Environment IO a +withModulePath packageInfo componentId moduleName action = + case HM.lookup + (ghcPrimHack packageInfo moduleName) + (HCE.moduleNameMap packageInfo) of + Just modulePathMap -> + case HM.lookup componentId modulePathMap of + Just path -> action path + Nothing -> + case HM.lookup (HCE.ComponentId "lib") modulePathMap of + Just path -> action path + Nothing -> + error404 $ + BSL.concat + [ "Module " + , toLazyBS $ HCE.getHaskellModuleName moduleName + , " is not found in component " + , toLazyBS $ HCE.getComponentId componentId + ] + Nothing -> + error404 $ + BSL.concat + [ "Module " + , toLazyBS $ HCE.getHaskellModuleName moduleName + , " is not found in package " + , toLazyBS $ + HCE.packageIdToText $ + HCE.id (packageInfo :: HCE.PackageInfo HCE.CompactModuleInfo) + ] + +-- | Workaround for : +-- https://github.com/ghc/ghc/blob/ghc-8.2.2-release/compiler/main/Finder.hs#L310-L315 +ghcPrimHack :: + HCE.PackageInfo HCE.CompactModuleInfo + -> HCE.HaskellModuleName + -> HCE.HaskellModuleName +ghcPrimHack packageInfo (HCE.HaskellModuleName modName) + | HCE.packageName packageInfo == "ghc-prim" && modName == "GHC.Prim" = + HCE.HaskellModuleName "GHC.Prim_" + | otherwise = HCE.HaskellModuleName modName + +parsePackageId :: PackageId -> Maybe (PackageName, Maybe Version) +parsePackageId (PackageId text) = + case T.splitOn "-" text of + [name] -> Just (PackageName name, Nothing) + chunks@(_x:_xs) -> + case mapM decimal . T.splitOn "." . last $ chunks of + Right numbers -> + Just + ( PackageName $ T.intercalate "-" . init $ chunks + , Just $ Version (map fst numbers) []) + Left _ -> Just (PackageName text, Nothing) + _ -> Nothing + +staticMiddleware :: String -> PackagePathMap -> Maybe FilePath -> Middleware +staticMiddleware staticFilesPrefix packagePathMap _ app req callback + | ("api":_) <- pathInfo req = app req callback + | (prefix:packageId:rest) <- pathInfo req + , prefix == T.pack staticFilesPrefix = + case HM.lookup (PackageId packageId) packagePathMap of + Just basePath + | ".." `notElem` rest -> do + let clientAcceptsEncoding = + fromMaybe [] $ + map T.strip . T.splitOn "," . TE.decodeUtf8 <$> + lookup "Accept-Encoding" (requestHeaders req) + clientAcceptsGzip = "gzip" `elem` clientAcceptsEncoding + path = basePath T.unpack (T.intercalate "/" rest) + gzPath = path ++ ".gz" + sendGzipFile <- + if clientAcceptsGzip + then doesFileExist gzPath + else return False + if sendGzipFile + then callback $ + responseFile + status200 + [ (hContentEncoding, "gzip") + , ( hContentType + , defaultMimeLookup . T.pack . takeFileName $ path) + ] + gzPath + Nothing + else do + exists <- doesFileExist path + if exists + then callback $ sendFile path + else callback fileNotFound + _ -> callback fileNotFound +staticMiddleware _ _ mbJsDistPath _app req callback = + case mbJsDistPath of + Just jsDistPath -> do + let path = jsDistPath T.unpack (T.intercalate "/" $ pathInfo req) + exists <- doesFileExist path + if exists + then callback $ sendFile path + else callback $ sendFile (jsDistPath "index.html") + Nothing -> callback fileNotFound + +sendFile :: FilePath -> Response +sendFile path = + responseFile + status200 + [(hContentType, defaultMimeLookup $ T.pack $ takeFileName path)] + path + Nothing + +fileNotFound :: Response +fileNotFound = + responseLBS status404 [("Content-Type", "text/plain")] "Not found" + +throwServantError :: (MonadIO m) => ServantErr -> m a +throwServantError = liftIO . throwIO + +server :: Environment -> ServerT API Handler +server env = + hoistServer + (Proxy :: Proxy API) + toServantHandler + (getAllPackages :<|> + getDefinitionSite :<|> + getExpressions :<|> + getReferences :<|> + findIdentifiers) + where + toServantHandler :: ReaderT Environment IO a -> Handler a + toServantHandler ma = Handler . ExceptT . try . runReaderT ma $ env + +application :: Environment -> Application +application env = serve (Proxy :: Proxy API) (server env) + +main :: IO () +main = do + config <- + execParser + (Options.Applicative.info + (configParser <**> helper) + (fullDesc <> + progDesc + "haskell-code-server provides an HTTP API for Haskell code explorer")) + print config + packages <- loadPackages config + case packages of + Just (packageMap, packagePathMap, packageVersions) -> do + loggerSet <- + case configLog config of + HCE.ToFile logfile -> newFileLoggerSet defaultBufSize logfile + HCE.StdOut -> newStdoutLoggerSet defaultBufSize + loggerMiddleware <- + liftIO $ + mkRequestLogger + def {outputFormat = Detailed True, destination = Logger loggerSet} + let staticFilePrefix = configStaticFilesUrlPrefix config + mbJsDistPath = configJsDistDirectory config + environment = + Environment + loggerSet + packageMap + (AllPackages . A.encode $ packageVersions) + config + static = + if configServeStaticFiles config + then staticMiddleware staticFilePrefix packagePathMap mbJsDistPath + else id + run + (configPort config) + (loggerMiddleware . static $ application environment) + Nothing -> putStrLn "No packages found." diff --git a/haskell-code-explorer.cabal b/haskell-code-explorer.cabal new file mode 100644 index 0000000..d62a598 --- /dev/null +++ b/haskell-code-explorer.cabal @@ -0,0 +1,137 @@ +name: haskell-code-explorer +version: 0.1.0.0 +synopsis: Web application for exploring and understanding Haskell codebases +Category: GHC,Web +description: Please see README.md +license: MIT +license-file: LICENSE +author: Alexey Kiryushin +maintainer: alexey.a.kiryushin@gmail.com +build-type: Simple +cabal-version: >=1.20 + +library + default-language: Haskell2010 + exposed-modules: HaskellCodeExplorer.PackageInfo + , HaskellCodeExplorer.ModuleInfo + , HaskellCodeExplorer.Types + , HaskellCodeExplorer.Preprocessor + , HaskellCodeExplorer.GhcUtils + , HaskellCodeExplorer.AST.RenamedSource + , HaskellCodeExplorer.AST.TypecheckedSource + hs-source-dirs: src + ghc-options: -Wall -O2 -funbox-strict-fields + build-depends: IntervalMap + , aeson + , attoparsec + , base + , blaze-html + , deepseq + , bytestring + , cabal-helper + , cereal + , containers + , directory + , directory-tree + , filemanip + , filepath + , ghc + , ghc-paths + , hashable + , haddock-library + , mtl + , process + , syb + , uniplate + , text + , unordered-containers + , vector + , fast-logger + , monad-logger + , extra + +executable haskell-code-indexer + main-is: Indexer.hs + ghc-options: -Wall -rtsopts -O2 -funbox-strict-fields + hs-source-dirs: app + build-depends: IntervalMap + , aeson + , base + , bytestring + , cereal + , directory + , filepath + , optparse-applicative + , text + , time + , unordered-containers + , uri-encode + , fast-logger + , monad-logger + , zlib + , haskell-code-explorer + default-language: Haskell2010 + +executable haskell-code-server + main-is: Server.hs + ghc-options: -Wall -O2 -rtsopts -funbox-strict-fields -threaded + hs-source-dirs: app,src + other-modules: HaskellCodeExplorer.Types + build-depends: IntervalMap + , aeson + , base + , bytestring + , cereal + , containers + , deepseq + , directory + , filemanip + , filepath + , blaze-html + , text + , unordered-containers + , hashable + , vector + , wai + , syb + , haddock-library + , servant + , servant-server + , mime-types + , mtl + , wai-extra + , wai-middleware-static + , warp + , http-types + , http-api-data + , fast-logger + , monad-logger + , optparse-applicative + , data-default + , pagination + if impl(ghc >= 8.4.3) + build-depends: ghc-compact + +test-suite test + default-language: Haskell2010 + type: exitcode-stdio-1.0 + ghc-options: -Wall + hs-source-dirs: test + main-is: Main.hs + build-depends: IntervalMap + , QuickCheck + , attoparsec + , base + , bytestring + , containers + , directory + , filepath + , hspec + , text + , uniplate + , unordered-containers + , monad-logger + , process + , vector + , syb + , haskell-code-explorer diff --git a/javascript/.ember-cli b/javascript/.ember-cli new file mode 100644 index 0000000..59bb55f --- /dev/null +++ b/javascript/.ember-cli @@ -0,0 +1,9 @@ +{ + /** + Ember CLI sends analytics information by default. The data is completely + anonymous, but there are times when you might want to disable this behavior. + + Setting `disableAnalytics` to true will prevent any data from being sent. + */ + "disableAnalytics": true +} diff --git a/javascript/.eslintrc.js b/javascript/.eslintrc.js new file mode 100644 index 0000000..56940e4 --- /dev/null +++ b/javascript/.eslintrc.js @@ -0,0 +1,15 @@ +module.exports = { + root: true, + parserOptions: { + ecmaVersion: 2017, + sourceType: 'module' + }, + extends: 'eslint:recommended', + env: { + browser: true + }, + rules: { + 'no-console':0, + "no-useless-escape": 0 + } +}; diff --git a/javascript/.gitignore b/javascript/.gitignore new file mode 100644 index 0000000..20b90e3 --- /dev/null +++ b/javascript/.gitignore @@ -0,0 +1,15 @@ +# compiled output +/dist +/tmp + +# dependencies +/node_modules +/bower_components + +# misc +/.sass-cache +/connect.lock +/coverage/* +/libpeerconnection.log +npm-debug.log +testem.log diff --git a/javascript/.watchmanconfig b/javascript/.watchmanconfig new file mode 100644 index 0000000..e7834e3 --- /dev/null +++ b/javascript/.watchmanconfig @@ -0,0 +1,3 @@ +{ + "ignore_dirs": ["tmp", "dist"] +} diff --git a/javascript/README.md b/javascript/README.md new file mode 100644 index 0000000..d73ef9e --- /dev/null +++ b/javascript/README.md @@ -0,0 +1,26 @@ +# haskell-code-explorer + +## Prerequisites +* [Node.js](https://nodejs.org/) (with NPM) +* [Ember CLI](https://ember-cli.com/) +* [bower](https://bower.io/) + +## Installation +* `cd haskell-code-explorer/javascript` +* `npm install` +* `bower install` + +## Running / Development +* Start haskell-code-server on port 8080 +* `ember server --port=4200 --proxy=http://localhost:8080` +* Visit your app at [http://localhost:4200](http://localhost:4200). + +To test the app with real-world data : +* ember server --proxy=https://haskell-code-explorer.mfix.io/ + +## Running Tests +* `ember server --port=4200` +* Open [http://localhost:4200/tests](http://localhost:4200/tests) in a browser + +## Building +* `ember build --environment production` diff --git a/javascript/app/app.js b/javascript/app/app.js new file mode 100644 index 0000000..9b24136 --- /dev/null +++ b/javascript/app/app.js @@ -0,0 +1,15 @@ +import Ember from 'ember'; +import Resolver from 'ember-resolver'; +import loadInitializers from 'ember-load-initializers'; +import config from './config/environment'; + +var App; + +App = Ember.Application.extend({ + modulePrefix: config.modulePrefix, + Resolver: Resolver +}); + +loadInitializers(App, config.modulePrefix); + +export default App; diff --git a/javascript/app/components/.gitkeep b/javascript/app/components/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/javascript/app/components/bottom-panel.js b/javascript/app/components/bottom-panel.js new file mode 100644 index 0000000..5d8b5bc --- /dev/null +++ b/javascript/app/components/bottom-panel.js @@ -0,0 +1,52 @@ +import Ember from 'ember'; + +function show(component) { + const height = Math.floor(component.$containerElement.height() /2); + component.$().css({ + "display":"block", + "top" : height+"px" + }); + component.$topPanelElement.css({ + "height":height+"px" + }); +} + +function hide(component) { + const height = Math.floor(component.$containerElement.height()/2); + component.$().css({ + "display":"none", + "height":height+"px" + }); + component.$topPanelElement.css({ + "height":"100%" + }); +} + +export default Ember.Component.extend({ + classNames:["bottom-panel"], + didInsertElement : function () { + this._super(...arguments); + this.$topPanelElement = Ember.$(this.get('topPanelElementId')); + this.$containerElement = Ember.$(this.get('containerElementId')); + Ember.run.next(this,() => { + Ember.$(this.element).resizable({ + handles:"n", + maxHeight:700, + minHeight:200, + resize: (event,ui) => { + Ember.run.next(this,() => { + this.$topPanelElement.css({"height": this.$containerElement.height() - ui.size.height}); + }); + } + }); + }); + }, + visibilityObserver : Ember.observer('visible',function () { + this.get('visible') ? show(this) : hide(this); + }), + actions : { + close () { + this.set('visible',false); + } + } +}); diff --git a/javascript/app/components/expression-info.js b/javascript/app/components/expression-info.js new file mode 100644 index 0000000..d403c49 --- /dev/null +++ b/javascript/app/components/expression-info.js @@ -0,0 +1,3 @@ +import Ember from 'ember'; +export default Ember.Component.extend({ +}); diff --git a/javascript/app/components/file-tree.js b/javascript/app/components/file-tree.js new file mode 100644 index 0000000..c86a71d --- /dev/null +++ b/javascript/app/components/file-tree.js @@ -0,0 +1,94 @@ +import Ember from 'ember'; + +const directoryTreeToJsTree = function (packageId,directoryTree) { + return directoryTree.contents.map((node) => { + const jsTreeNode = {}; + jsTreeNode.text = node.name; + jsTreeNode.data = node; + if(node.path) { + jsTreeNode.id = node.path; + jsTreeNode.a_attr = {href:"/package/" + packageId + "/show/" + node.path}; + } + if(node.tag === "Dir") { + jsTreeNode.children = directoryTreeToJsTree(packageId,node); + jsTreeNode.state = {"opened" : containsHaskellModule(node)}; + } else { + if(node.isHaskellModule) { + jsTreeNode.icon = "/assets/haskell.ico"; + jsTreeNode.isHaskellModule = true; + } else { + jsTreeNode.icon = "jstree-file"; + jsTreeNode.isHaskellModule = false; + } + } + return jsTreeNode; + }); +}; + +const containsHaskellModule = function(node) { + return node.contents.some((n) => { + if(n.tag === "File") { + return n.isHaskellModule; + } else { + return containsHaskellModule(n); + } + }); +} + +export default Ember.Component.extend({ + query: null, + didInsertElement : function () { + this._super(...arguments); + const element = this.element.getElementsByClassName('file-tree')[0]; + + const jstreeElement = Ember.$(element).jstree({ + 'core' : { + 'data' : directoryTreeToJsTree(this.get('packageId'),this.get('directoryTree')) + }, + "plugins" : [ + "search" + ], + "search": { + "case_insensitive": true, + "show_only_matches" : true, + "show_only_matches_children": true + } + }); + + jstreeElement.on("select_node.jstree",(event,data) => { + const file = data.node.data; + if(file.tag != "Dir") { + this.sendAction('openFile',file.path); + } + }); + + const jstree = jstreeElement.jstree(true); + + if(this.get('currentFile')) { + jstree.select_node(this.get('currentFile')); + const node = jstree.get_node(this.get('currentFile'),true)[0]; + if(node) { + node.scrollIntoView(); + } + } + this.jstree = jstree; + }, + currentFileObserver : Ember.observer('currentFile',function() { + Ember.run.next(() => { + this.jstree.deselect_all(); + this.jstree.select_node(this.get('currentFile')); + }); + }), + queryObserver : Ember.observer('query',function() { + if(this.get('query')) { + this.jstree.search(this.get('query')); + } else { + this.jstree.clear_search(); + } + }), + actions : { + hide() { + this.get('hide')(); + } + } +}); diff --git a/javascript/app/components/haskell-module.js b/javascript/app/components/haskell-module.js new file mode 100644 index 0000000..8883a9c --- /dev/null +++ b/javascript/app/components/haskell-module.js @@ -0,0 +1,492 @@ +import Ember from 'ember'; +import {goToDefinition} from '../utils/go-to-definition'; +import {initializeLineSelection} from '../utils/line-selection'; + +function compareLocations (p1,p2) { + if(p1.line === p2.line) { + if(p1.column === p2.column) { + return 0; + } else if(p1.column > p2.column) { + return 1; + } else { + return -1; + } + } else if(p1.line > p2.line) { + return 1; + } else { + return -1; + } +} + +function buildSrcSpan(sourceCodeLines,start,end) { + if(sourceCodeLines[start.line] && sourceCodeLines[end.line]) { + if(start.line === end.line) { + return sourceCodeLines[start.line].slice(start.column-1,end.column-1); + } else { + const firstLine = sourceCodeLines[start.line]; + let middleLines = []; + for(let i = start.line + 1; i < end.line;i ++) { + middleLines.push(sourceCodeLines[i]); + } + const lastLine = sourceCodeLines[end.line]; + const minOffset = Math.min(start.column, + (middleLines.concat([lastLine])) + .map((line) => line.search(/\S/)) + .reduce((min,value) => Math.min(min,value))); + return firstLine.slice(start.column-1,firstLine.length) + "\n" + + middleLines.map((line) => line.slice(minOffset,line.length)).join("\n") + + (middleLines.length ? "\n" : "") + lastLine.slice(minOffset,end.column-1); + } + } else { + return null; + } +} + +function modifyClass(element,on) { + if(on) { + element.classList.add('highlighted-identifier'); + } else { + element.classList.remove('highlighted-identifier'); + } +} + +function highlightIdentifiers(parentElement,identifierElement,on) { + if(identifierElement.id) { + const identifiers = Array.prototype.slice.call(parentElement.querySelectorAll("span[id='"+identifierElement.id+"']")); + identifiers.forEach((identifier) => { + modifyClass(identifier,on); + }); + } else { + modifyClass(identifierElement,on);//Literal + } +} + +//divident is a string +//divident may have any number of digits +function modulo(divident, divisor) { + return Array.from(divident).map(c => parseInt(c)) + .reduce((acc, value) => { + return (acc * 10 + value) % divisor; + },0); +} + +function isDefinedInCurrentModule(moduleName,modulePath,identifierInfo) { + return (identifierInfo.sort === "External") && + (identifierInfo.locationInfo.modulePath === modulePath + || identifierInfo.locationInfo.moduleName === moduleName) +} + +function identifierStyle(identifierElement, + identifiers, + occurrences, + path, + colorTheme, + moduleName) { + const idOcc = occurrences[identifierElement.dataset.occurrence]; + + let color = colorTheme.defaultColor; + let fontWeight; + + if(idOcc) { + if(idOcc.sort.tag === 'TypeId') { + color = colorTheme.typeColor; + } else if(idOcc.description === "HsLit" || + idOcc.description === "HsOverLit"|| + idOcc.description === "LitPat" || + idOcc.description === "NPat" || + idOcc.description === "NPlusKPat" || + idOcc.description === "OverLit") { + color = colorTheme.literalColor; + } else { + const idInfo = identifiers[identifierElement.dataset.identifier]; + if(idInfo) { + if(isDefinedInCurrentModule(moduleName,path,idInfo)) { + color = colorTheme.topLevelIdFromCurrentModule; + } else if(idInfo.sort === "Internal" && idInfo.locationInfo.tag === "ExactLocation") { + const colorNumber = modulo(identifierElement.id,colorTheme.localIdentifierColor.length); + color = colorTheme.localIdentifierColor[colorNumber]; + fontWeight = "bold"; + } + } + } + } + + return "color:"+color+";" + +(fontWeight ? "font-weight:" + fontWeight : "")+";" + +(idOcc.isBinder ? "text-decoration:underline;" : ""); +} + +function initializeIdentifiers (sourceCodeContainerElement,component) { + const identifierElements = Array.prototype.slice.call(sourceCodeContainerElement.querySelectorAll("span.identifier")); + if(identifierElements.length > 0) { + const timeout = 250;//milliseconds + let timer = null; + + identifierElements.forEach((identifierElement) => { + + const cssText = identifierStyle(identifierElement, + component.get('identifiers'), + component.get('occurrences'), + component.get('path'), + component.get('colorTheme'), + component.get('name')); + + identifierElement.style.cssText = cssText; + + //go to definition + identifierElement.onmouseup = (event) => { + if(timer) { + clearTimeout(timer); + } + + if(!window.getSelection().isCollapsed) { + return; + } + + const identifierInfo = component.get('identifiers')[identifierElement.dataset.identifier]; + const idOccurrenceInfo = component.get('occurrences')[identifierElement.dataset.occurrence]; + + const currentLineNumber = parseInt(identifierElement.parentNode.dataset.line); + + if(idOccurrenceInfo.sort.tag === "ModuleId") { + goToDefinition(component.get('store'), + idOccurrenceInfo.sort.contents, + event.which, + currentLineNumber); + } + else { + if(!idOccurrenceInfo.isBinder && identifierInfo + && (event.which === 1 || event.which === 2)) { + goToDefinition(component.get('store'), + identifierInfo.locationInfo, + event.which, + currentLineNumber); + } + } + } + + identifierElement.onmouseover = () => { + highlightIdentifiers(sourceCodeContainerElement,identifierElement,true); + if(timer) { + clearTimeout(timer); + } + timer = setTimeout(() => { + Ember.run.next(component,() => { + const identifierInfo = component.get('identifiers')[identifierElement.dataset.identifier]; + const identifierOccurrence = component.get('occurrences')[identifierElement.dataset.occurrence]; + console.log(identifierOccurrence); + console.log(identifierInfo); + + component.set('selectedIdentifier',identifierElement); + component.set('currentLineNumber',parseInt(identifierElement.parentNode.dataset.line) || 1); + component.set('identifierInfo',identifierInfo); + component.set('identifierOccurrence',identifierOccurrence); + component.set('hasSelectedExpression',false); + component.set('isHoveredOverIdentifier',true); + + }); + },timeout); + }; + + identifierElement.onmouseout = () => { + highlightIdentifiers(sourceCodeContainerElement,identifierElement,false); + + if(timer) { + clearTimeout(timer); + } + + timer = setTimeout (() => { + Ember.run.next(component,() => { + component.set('isHoveredOverIdentifier',false); + }); + },timeout); + }; + }); + component.timer = timer; + } +} + + + +function contains (node, other) { + return node === other || !!(node.compareDocumentPosition(other) & 16); +} + +function initializeExpressionInfo(sourceCodeContainerElement,component) { + const lineElements = Array.prototype.slice.call(sourceCodeContainerElement.querySelectorAll("td.line-content")); + if(lineElements.length > 0) { + + //Line numbers start with 1 + let sourceCodeLines = [""]; + + lineElements.forEach((el) => { + sourceCodeLines.push(el.textContent); + }); + + const allowedNodeNames = ["#text","SPAN","TD"]; + let isLoading = false; + let shouldWait = false; + const timeout = 400;//milliseconds + + const onmouseup = function() { + Ember.run.next(() => { + if(isLoading || shouldWait) { + return; + } + shouldWait = true; + setTimeout(() => {shouldWait = false;},timeout); + + component.set('hasSelectedExpression',false); + + const selection = window.getSelection(); + + //Selection of multiple lines inside a table doesn't work in Firefox + //https://bugzilla.mozilla.org/show_bug.cgi?id=365900 + + if(!(selection.anchorNode && selection.focusNode) + || !contains(sourceCodeContainerElement,selection.anchorNode) + || !contains(sourceCodeContainerElement,selection.focusNode) + || (allowedNodeNames.indexOf(selection.anchorNode.nodeName) === -1) + || (allowedNodeNames.indexOf(selection.focusNode.nodeName) === -1) + || selection.isCollapsed) { + return; + } + + // Detects whether the selection is backwards + const detectionRange = document.createRange(); + detectionRange.setStart(selection.anchorNode, selection.anchorOffset); + detectionRange.setEnd(selection.focusNode, selection.focusOffset); + const isBackward = detectionRange.collapsed; + + let startNode,startNodeOffset,endNode,endNodeOffset; + + if(isBackward) { + startNode = selection.focusNode; + startNodeOffset = selection.focusOffset; + endNode = selection.anchorNode; + endNodeOffset = selection.anchorOffset; + } else { + startNode = selection.anchorNode; + startNodeOffset = selection.anchorOffset; + endNode = selection.focusNode; + endNodeOffset = selection.focusOffset; + } + + let lineStart,columnStart,lineEnd,columnEnd; + let infoWindowTargetElement; + + + //HTML inside source code container : + //abc... + //... + if(startNode.nodeName === "#text") { + const parent = startNode.parentNode;// + columnStart = parseInt(parent.dataset.start) + startNodeOffset; + lineStart = parseInt(parent.parentNode.dataset.line); + + if(startNodeOffset === startNode.textContent.length && parent.nextSibling === null) { + const tr = startNode.parentNode.parentNode.parentNode;// span -> td -> tr + + //Skipping empty lines + let nextLine = tr.nextSibling; + while(nextLine.children[1].textContent === "") { + nextLine = nextLine.nextSibling; + } + infoWindowTargetElement = nextLine.children[1].children[0]; + + } else { + if(!(startNodeOffset === 0) && (parent.nextSibling)) { + infoWindowTargetElement = parent.nextSibling; + } else { + infoWindowTargetElement = parent; + } + } + } else if(startNode.nodeName === "SPAN") { + columnStart = 1; + lineStart = parseInt(startNode.parentNode.dataset.line); + + const tr = startNode.parentNode.parentNode; // td -> tr + let nextLine = tr.nextSibling; + while(nextLine.children[1].textContent === "") { + nextLine = nextLine.nextSibling; + } + infoWindowTargetElement = nextLine.children[1].children[0]; + + } else if(startNode.nodeName === "TD") { + if(startNodeOffset > 0) { + const child = startNode.children[startNodeOffset-1]; + columnStart = parseInt(child.dataset.start); + } else { + columnStart = 1; + } + lineStart = parseInt(startNode.id.slice(2)); + infoWindowTargetElement = startNode.children[0]; + } + + if(endNode.nodeName === "#text") { + columnEnd = parseInt(endNode.parentNode.dataset.start) + endNodeOffset; + lineEnd = parseInt(endNode.parentNode.parentNode.dataset.line); + } else if(endNode.nodeName === "SPAN") { + columnEnd = 1; + lineEnd = parseInt(endNode.parentNode.dataset.line); + } else if(endNode.nodeName === "TD"){ + if(endNodeOffset > 0) { + const child = endNode.children[endNodeOffset-1]; + columnEnd = parseInt(child.dataset.start); + } else { + columnEnd = 1; + } + lineEnd = parseInt(endNode.id.slice(2)); + } + + const loadExprPromise = component.get('store').loadExpressions( + component.get('packageId'), + component.get('path'), + lineStart, + columnStart, + lineEnd, + columnEnd); + isLoading = true; + + loadExprPromise.then((expressions) => { + Ember.run.next(() => { + if(expressions && expressions.length > 0) { + expressions.sort(function(expr1,expr2) { + if( compareLocations(expr1.srcSpan.start,expr2.srcSpan.start) <= 0 + && compareLocations(expr1.srcSpan.end,expr2.srcSpan.end) >= 0 ) { + return -1; + } else { + return 1; + } + }); + + const expressionsWithSourceCode = expressions.reduce((result,expression) => { + const object = Ember.copy(expression); + const srcSpan = buildSrcSpan(sourceCodeLines, + expression.srcSpan.start, + expression.srcSpan.end); + if(srcSpan) { + object.sourceCode = srcSpan; + return result.concat(object); + } else { + return result; + } + },[]); + + if(expressionsWithSourceCode.length > 0) { + component.set('selectedIdentifier',infoWindowTargetElement); + component.set('expressions',expressionsWithSourceCode); + component.set('currentLineNumber',parseInt(infoWindowTargetElement.parentNode.dataset.line) || 1); + component.set('hasSelectedExpression',true); + + } + } + isLoading = false; + }); + }); + }); + }; + + sourceCodeContainerElement.addEventListener('mouseup',onmouseup); + component._onmouseup = onmouseup; + } +} + +export default Ember.Component.extend({ + store : Ember.inject.service('store'), + selectedIdentifier : null, + isHoveredOverIdentifier : false, + hasSelectedExpression : false, + showDeclarations : true, + showDeclarationsLabel : Ember.computed('showDeclarations',function () { + return this.get('showDeclarations') ? "Hide" : "Show"; + }), + queryObserver : Ember.observer("query",function() { + Ember.run.debounce(this, () => { + const regExp = new RegExp(this.get('query'),"i"); + const filteredDeclarations = this.get('declarations').filter((d) => d.name.search(regExp) != -1); + Ember.run.next(() => { + this.set('filteredDeclarations',filteredDeclarations); + }); + }, 300); + }), + identifierLocationInfo : Ember.computed('identifierInfo','identifierOccurrence',function() { + const idOcc = this.get('identifierOccurrence'); + const idInfo = this.get('identifierInfo'); + if(idOcc) { + if(idOcc.sort.tag === "ModuleId") { + return idOcc.sort.contents; + } else { + if(idInfo) { + return idInfo.locationInfo; + } else { + return null; + } + } + } + }), + themeObserver : Ember.observer('colorTheme',function() { + Ember.run.next(this,() => { + this.cleanup(); + this.didInsertElement(); + }); + }), + fileObserver : Ember.observer('path',function() { + Ember.run.next(this,() => { + this.cleanup(); + this.didInsertElement(); + }); + }), + cleanup() { + if(this.timer) { + clearTimeout(this.timer); + } + if(this._onhashchange) { + window.removeEventListener('hashchange',this._onhashchange); + } + if(this._onkeydown) { + document.removeEventListener('keydown',this._onkeydown); + } + if(this._onkeyup) { + document.removeEventListener('keyup',this._onkeyup); + } + if(this._onmouseup) { + this.sourceCodeContainerElement.removeEventListener('mouseup',this._onmouseup); + } + this.set('selectedIdentifier',null); + this.set('isHoveredOverIdentifier',false); + this.set('hasSelectedExpression',false); + this.set('showDeclarations',true); + }, + didReceiveAttrs() { + this.set('filteredDeclarations',this.get('declarations')); + }, + didInsertElement() { + this._super(...arguments); + const sourceCodeContainerElement = this.element.querySelector('.source-code-container'); + sourceCodeContainerElement.innerHTML = this.get('html'); + this.sourceCodeContainerElement = sourceCodeContainerElement; + this.element.parentNode.scrollTop = 0; + const declarations = this.element.querySelector('.declarations-content'); + this.set('query',''); + if(declarations) { + declarations.scrollTop = 0; + } + Ember.run.next(this,() => { + initializeIdentifiers(sourceCodeContainerElement,this); + initializeLineSelection(sourceCodeContainerElement,this); + initializeExpressionInfo(sourceCodeContainerElement,this); + }); + }, + willDestroyElement() { + this.cleanup(); + }, + actions : { + goToLine(lineNumber) { + window.location.hash = "L"+lineNumber; + }, + toggleShowDeclarations() { + this.toggleProperty('showDeclarations'); + } + } +}); diff --git a/javascript/app/components/identifier-info.js b/javascript/app/components/identifier-info.js new file mode 100644 index 0000000..537697a --- /dev/null +++ b/javascript/app/components/identifier-info.js @@ -0,0 +1,62 @@ +import Ember from 'ember'; +import {goToDefinition} from '../utils/go-to-definition'; + +export default Ember.Component.extend({ + store : Ember.inject.service('store'), + downloadedDocumentation : null, + didInsertElement () { + const onmouseup = (event) => { + if(event.target.dataset.location) { + let location; + try { + location = JSON.parse(event.target.dataset.location); + } catch (e) { + console.log(e); + } + if(location) { + goToDefinition(this.get('store'),location,event.which,this.get('currentLineNumber')); + } + } + }; + this.element.addEventListener('mouseup',onmouseup); + this._onmouseup = onmouseup; + }, + willDestroyElement : function () { + if(this._onmouseup) { + this.element.removeEventListener('mouseup',this._onmouseup); + } + }, + //Naughty record selectors : + //https://github.com/ghc/ghc/blob/ced2cb5e8fbf4493488d1c336da7b00d174923ce/compiler/typecheck/TcTyDecls.hs#L940-L961 + isNaughtyRecSel : Ember.computed('identifierInfo',function () { + const idInfo = this.get('identifierInfo'); + return idInfo ? (idInfo.details === "RecSelIdNaughty") : false; + }), + isExternalIdentifier : Ember.computed('identifierInfo',function () { + const idInfo = this.get('identifierInfo'); + return idInfo ? (idInfo.sort === "External") : false; + }), + identifierObserver : Ember.observer('identifierInfo',function () { + this.set("downloadedDocumentation",""); + const idInfo = this.get('identifierInfo'); + if(idInfo) { + const locationInfo = idInfo.locationInfo; + if(locationInfo.tag === "ApproximateLocation") { + const packageId = locationInfo.packageId.name + "-" + locationInfo.packageId.version; + const currentIdentifier = idInfo; + + this.get('store').loadDefinitionSite(packageId, + locationInfo.moduleName, + locationInfo.componentId, + locationInfo.entity, + locationInfo.name) + .then((definitionSite) => { + Ember.run.next(this,() => { + if(currentIdentifier === this.get('identifierInfo')) { + this.set('downloadedDocumentation',definitionSite.documentation); + }}); + }); + } + } + }) +}); diff --git a/javascript/app/components/identifier-name.js b/javascript/app/components/identifier-name.js new file mode 100644 index 0000000..950b8c7 --- /dev/null +++ b/javascript/app/components/identifier-name.js @@ -0,0 +1,60 @@ +import Ember from 'ember'; +import {goToDefinition} from '../utils/go-to-definition'; + +export default Ember.Component.extend({ + store : Ember.inject.service('store'), + name : Ember.computed('identifierElement',function() { + const element = this.get('identifierElement'); + if(element) { + return element.innerText; + } + }), + style : Ember.computed('identifierElement',function() { + const element = this.get('identifierElement'); + if(element) { + return new Ember.String.htmlSafe("color:"+element.style.color); + } + }), + locationInfo : Ember.computed('identifierInfo','identifierOccurrence',function() { + if(this.get('identifierOccurrence.sort.tag') === "ModuleId") { + return this.get('identifierOccurrence.sort.contents'); + } else { + return this.get('identifierInfo.locationInfo'); + } + }), + location : Ember.computed('locationInfo',function() { + const loc = this.get('locationInfo'); + if(loc) { + if(loc.tag === "ExactLocation") { + return loc.modulePath; + } else if(loc.tag === "ApproximateLocation") { + if(loc.entity === "Mod") { + return loc.packageId.name + "-" + loc.packageId.version; + } else { + return loc.packageId.name + "-" + loc.packageId.version + " " + loc.moduleName; + } + } else { + return loc.contents; + } + } else { + return ""; + } + }), + isExternalIdentifier : Ember.computed('identifierInfo',function () { + return (this.get('identifierInfo.sort') === "External"); + }), + actions : { + goToDefinition (event) { + goToDefinition(this.get('store'), + this.get('locationInfo'), + event.which, + this.get('currentLineNumber')); + return false; + }, + findReferences (identifierInfo,currentPackageId) { + this.get('findReferences')(currentPackageId, + identifierInfo.externalId, + identifierInfo.demangledOccName); + } + } +}); diff --git a/javascript/app/components/infinite-list.js b/javascript/app/components/infinite-list.js new file mode 100644 index 0000000..b73b6d4 --- /dev/null +++ b/javascript/app/components/infinite-list.js @@ -0,0 +1,50 @@ +import Component from '@ember/component'; +import { run } from '@ember/runloop'; +import { observer } from '@ember/object'; + +let pageNumber; +let updating = false; + +function initialize(component) { + component.set('renderedElements',component.get('elements').slice(0,component.get('perPage'))); + pageNumber = 1; +} + +export default Component.extend({ + renderedElements : [], + init() { + this._super(...arguments); + initialize(this); + }, + elementsObserver : observer('elements',function() { + initialize(this); + const containerElement = document.getElementById(this.get('containerElementId')); + if(containerElement) { + containerElement.scrollTop = 0; + } + }), + didInsertElement() { + const containerElement = document.getElementById(this.get('containerElementId')); + if(containerElement) { + const component = this; + containerElement.onscroll = function() { + const perPage = component.get('perPage'); + const elements = component.get('elements'); + + if(!updating && + (pageNumber * perPage < elements.length) && + (containerElement.scrollTop + containerElement.offsetHeight + > component.element.offsetHeight - 100)) { + + updating = true; + run.next(component,() => { + const newElements = elements.slice(pageNumber * perPage,(pageNumber + 1) * perPage); + component.get('renderedElements').pushObjects(newElements); + pageNumber ++; + updating = false; + }); + } + } + } + } +}); diff --git a/javascript/app/components/info-window.js b/javascript/app/components/info-window.js new file mode 100644 index 0000000..a011f99 --- /dev/null +++ b/javascript/app/components/info-window.js @@ -0,0 +1,144 @@ +import Ember from 'ember'; + +let resizing = false; +let dragging = false; + +function updatePosition(component) { + const targetElement = component.get('targetElement'); + if(targetElement) { + const infoWindowHeight = component.element.offsetHeight; + const targetElementHeight = targetElement.offsetHeight; + + const parent = targetElement.parentNode;// element + const containerElement = document.querySelector("#" + component.get('containerElementId')); + + //getBoundingClientRect() returns the smallest rectangle which contains + //the entire element, with read-only left, top, right, bottom, x, y, width, + //and height properties describing the overall border-box in pixels. Properties + //other than width and height are relative to the top-left of the *viewport*. + const targetTopViewport = targetElement.getBoundingClientRect().top; + + let containerTopViewport; + if (containerElement) { + containerTopViewport = containerElement.getBoundingClientRect().top; + } else { + containerTopViewport = 0; + } + + let infoWindowTop; + if(targetTopViewport < infoWindowHeight + containerTopViewport) { + //offsetTop is the number of pixels from the top of the closest relatively + //positioned parent element. + infoWindowTop = targetElement.offsetTop + parent.offsetTop + + targetElementHeight + 10 + "px"; + } else { + infoWindowTop = targetElement.offsetTop + parent.offsetTop + - infoWindowHeight + "px"; + } + + const infoWindowLeft = targetElement.offsetLeft + parent.offsetLeft + "px"; + + component.$().css({ + top:infoWindowTop, + left:infoWindowLeft + }); + } else { + component.set('isPinned',false); + } +} + +export default Ember.Component.extend({ + classNames : ["info-window-container"], + attributeBindings: ['hidden'], + isPinned : false, + isFocused: false, + didInsertElement () { + const component = this; + + const $headerElement = Ember.$(component.element.querySelector(".info-window-header")); + const $contentElement = Ember.$(component.element.querySelector(".info-window-content")); + const $infoWindowElement = Ember.$(component.element.querySelector(".info-window")); + const $infoWindowContainerElement = Ember.$(component.element); + + this.$headerElement = $headerElement; + this.$contentElement = $contentElement; + + this.$().resizable({ + handles: "n,w", + minHeight: 80, + minWidth: 400, + start: function() { + resizing = true; + }, + stop: function() { + resizing = false; + }, + resize : function() { + const containerHeight = $infoWindowContainerElement.height(); + $infoWindowElement.css({ + "height": containerHeight + 2 + "px" + }); + $contentElement.css({ + "max-height":(containerHeight - $headerElement.outerHeight(true)) + "px" + }); + } + }); + this.$().draggable({ + containment:"#" + this.get('containerElementId'), + handle: $headerElement, + start: function() { + dragging = true; + }, + stop: function() { + dragging = false; + } + }); + }, + mouseEnter () { + if(!this.get('hasSelectedExpression')) { + this.set('isFocused',true); + } + }, + mouseLeave (event) { + //Workaround for a bug in Chrome + const element = document.elementFromPoint(event.clientX,event.clientY); + if(element && element.classList.contains('link')) { + return; + } + if(!resizing + && !dragging + && !this.get('isPinned') + && !this.get('hasSelectedExpression')) { + this.set('isFocused',false); + } + }, + hidden : Ember.computed('isHoveredOverIdentifier', + 'isFocused', + 'hasSelectedExpression', + 'isPinned', function() { + if (this.$contentElement) { + this.$contentElement.scrollTop(0); + } + if (this.get('isPinned') + || this.get('isFocused') + || this.get('isHoveredOverIdentifier') + || this.get('hasSelectedExpression')) { + return false; + } else { + return true; + } + }), + didUpdate() { + updatePosition(this); + }, + actions : { + close() { + this.set('isPinned',false); + this.set('isFocused',false); + this.set('hasSelectedExpression',false); + }, + pin() { + this.toggleProperty('isPinned'); + } + } +}); diff --git a/javascript/app/components/input-with-autocomplete.js b/javascript/app/components/input-with-autocomplete.js new file mode 100644 index 0000000..2b09ea4 --- /dev/null +++ b/javascript/app/components/input-with-autocomplete.js @@ -0,0 +1,131 @@ +import Ember from 'ember'; +export default Ember.Component.extend({ + store : Ember.inject.service('store'), + highlightedItemIndex: -1, + items : [], + query: null, + didInsertElement() { + const $input = Ember.$(this.element).find(".search-input"); + const $autocompleteContainer = Ember.$(this.element).find(".autocomplete-container"); + this.$input = $input; + this.$autocompleteContainer = $autocompleteContainer; + const width = $input.width() + 300; + $autocompleteContainer.css({ + "width" : width+"px", + "top" : $input.outerHeight() + }); + $input.keyup((e) => { + if(e.which === 13) { + this.onEnter(); + } else if(e.which === 27) { + this.onEsc(); + } else if(e.which === 40) { + this.onDown(); + } else if(e.which === 38) { + this.onUp(); + } + }); + $input.focusin(() => { + this.showAutocompleteList(); + }); + $input.focusout(() => { + //Timeout is needed to make sure that click event fires + Ember.run.later((() => { + this.hideAutocompleteList(); + }), 100); + }); + }, + willDestroyElement() { + this._super(...arguments); + this.$input.off('keyup'); + this.$input.off('focusin'); + this.$input.off('focusout'); + }, + onEnter() { + if(this.get('highlightedItemIndex') !== -1) { + const item = this.get('items')[this.get('highlightedItemIndex')]; + if(item) { + this.hideAutocompleteList(); + this.get('selectItem')(item); + } + } else { + this.hideAutocompleteList(); + this.get('onSubmit')(this.get('query')); + } + }, + onEsc() { + this.hideAutocompleteList(); + }, + onDown() { + this.showAutocompleteList(); + const index = this.get('highlightedItemIndex'); + const items = this.get('items'); + const itemsCount = items.length; + if(itemsCount > 0) { + if(index !== -1) { + if(index === itemsCount - 1) { + this.set('highlightedItemIndex',0); + } else { + this.set('highlightedItemIndex',index+1); + } + } else { + this.set('highlightedItemIndex',0); + } + } + }, + onUp() { + this.showAutocompleteList(); + const index = this.get('highlightedItemIndex'); + const items = this.get('items'); + const itemsCount = items.length; + if(itemsCount > 0) { + if(index !== -1) { + if(index === 0) { + this.set('highlightedItemIndex',itemsCount - 1); + } else { + this.set('highlightedItemIndex',index - 1); + } + } else { + this.set('highlightedItemIndex',itemsCount - 1); + } + } + }, + hideAutocompleteList() { + this.set('highlightedItemIndex',-1); + this.$autocompleteContainer.css({ + "display":"none", + }); + }, + showAutocompleteList() { + this.$autocompleteContainer.css({ + "display":"block" + }); + }, + queryObserver : Ember.observer("query",function() { + if(this.get('query')) { + const perPage = this.get('maxItems') ? this.get('maxItems') : 10; + const url = this.get('createSearchUrlFunction')(this.get('query')) + "?per_page=" + perPage; + Ember.run.debounce(this, () => { + this.get('store').loadFromUrlPaginated(url).then((result) => { + Ember.run.next(() => { + this.set('items',result.items); + }); + }); + }, 400); + this.showAutocompleteList(); + } else { + this.hideAutocompleteList(); + this.set('items',[]); + } + }), + actions : { + onSubmit() { + this.hideAutocompleteList(); + this.get('onSubmit')(this.get('query')); + }, + goToDefinition (item) { + this.hideAutocompleteList(); + this.get('selectItem')(item); + } + } +}); diff --git a/javascript/app/components/instance-info.js b/javascript/app/components/instance-info.js new file mode 100644 index 0000000..a0e04ed --- /dev/null +++ b/javascript/app/components/instance-info.js @@ -0,0 +1,21 @@ +import Ember from 'ember'; +import {goToDefinition} from '../utils/go-to-definition'; + +export default Ember.Component.extend({ + store : Ember.inject.service('store'), + style : Ember.computed('nestedLevel',function() { + return new Ember.String.htmlSafe("margin-left :" + this.get('nestedLevel') * 10 + "px"); + }), + nextNestedLevel : Ember.computed('nestedLevel',function () { + return this.get('nestedLevel') + 1; + }), + actions : { + goToDefinition (event) { + goToDefinition(this.get('store'), + this.get('instance.location'), + event.which, + this.get('currentLineNumber')); + return false; + } + } +}); diff --git a/javascript/app/components/paginated-list.js b/javascript/app/components/paginated-list.js new file mode 100644 index 0000000..9d85610 --- /dev/null +++ b/javascript/app/components/paginated-list.js @@ -0,0 +1,48 @@ +import Ember from 'ember'; +function loadItems(store,component,url) { + store.loadFromUrlPaginated(url).then((result) => { + Ember.run.next(() => { + component.set('total',result.total); + component.set('items',result.items); + component.set('first',result.linkHeader.first); + component.set('next',result.linkHeader.next); + component.set('prev',result.linkHeader.prev); + component.set('last',result.linkHeader.last); + + const pageMatch = url.match(/(&|\?)page=(\d+)/); + const perPageMatch = url.match(/(&|\?)per_page=(\d+)/); + + const page = pageMatch ? pageMatch[2] : 1; + const perPage = perPageMatch ? perPageMatch[2] : 20; + + if(result.linkHeader.next || result.linkHeader.prev) { + component.set('firstItemOnPage',(page - 1) * perPage + 1); + if(!result.linkHeader.last) { + component.set('lastItemOnPage',result.total); + } else { + component.set('lastItemOnPage',page * perPage); + } + } + }); + }); +} + +export default Ember.Component.extend({ + store : Ember.inject.service('store'), + init() { + this._super(...arguments); + if(this.get('url')) { + loadItems(this.get('store'),this,this.get('url')); + } + }, + urlObserver : Ember.observer('url',function () { + loadItems(this.get('store'),this,this.get('url')); + this.element.querySelector(".paginated-list-content").scrollTop = 0; + }), + actions : { + update(url) { + this.element.querySelector(".paginated-list-content").scrollTop = 0; + loadItems(this.get('store'),this,url); + } + } +}); diff --git a/javascript/app/components/resizable-panel.js b/javascript/app/components/resizable-panel.js new file mode 100644 index 0000000..8dae7ed --- /dev/null +++ b/javascript/app/components/resizable-panel.js @@ -0,0 +1,72 @@ +import Ember from 'ember'; + +function hide (component,byUser) { + component.$alsoResizeElement.css({left: 0}); + component.$().css({width:0}); + component.set('hidden',true); + component.$(".show-left-panel-button").show(); + if(byUser) { + component.set('hiddenByUser',true); + } +} + +function show (component,byUser) { + component.$alsoResizeElement.css({left: 300}); + component.$().css({width:300}); + component.set('hidden',false); + component.$(".show-left-panel-button").hide(); + if(byUser) { + component.set('hiddenByUser',false); + } +} + +export default Ember.Component.extend({ + hidden:false, + hiddenByUser:false, + didInsertElement : function () { + this._super(...arguments); + Ember.run.next(this,() => { + const onresize = () => { + if(!this.get('hiddenByUser')) { + const width = window.innerWidth; + if(!this.get('hidden') && width < 700) { + hide(this,false); + } else if(this.get('hidden') && width > 700) { + show(this,false); + } + } + }; + this._onresize = onresize; + window.addEventListener('resize', onresize); + const $alsoResizeElement = Ember.$(this.get('alsoResizeElementId')); + Ember.$(this.element).resizable({ + maxWidth: 800, + minWidth: 200, + handles: 'e', + resize: (event,ui) => { + Ember.run.next(this,() => { + $alsoResizeElement.css({left: ui.size.width}); + }); + } + }); + this.$alsoResizeElement = $alsoResizeElement; + }); + }, + hideButtonLabel : Ember.computed('hidden',function() { + return this.get('hidden') ? ">" : "<"; + }), + willDestroyElement() { + if(this._onresize) { + window.removeEventListener('resize',this._onresize); + } + }, + actions : { + hide() { + if(this.get('hidden')) { + show(this,true); + } else { + hide(this,true); + } + } + } +}); diff --git a/javascript/app/components/text-file.js b/javascript/app/components/text-file.js new file mode 100644 index 0000000..05be31a --- /dev/null +++ b/javascript/app/components/text-file.js @@ -0,0 +1,67 @@ +/* global showdown */ +import Ember from 'ember'; +import {initializeLineSelection} from '../utils/line-selection'; + +function escapeHtml(text) { + return text.replace(/[\"&<>]/g, function (a) { + return { '"': '"', '&': '&', '<': '<', '>': '>' }[a]; + }); +} + +function addLineNumbers (text) { + const start = ""; + const end = "
"; + let lineNumber = 0; + const lines = text.split("\n").map((line) => { + lineNumber ++; + const lineNumberHtml = ""+lineNumber+""; + const lineContentHtml = ""+escapeHtml(line)+""; + return ""+ lineNumberHtml + lineContentHtml + ""; + }).join(""); + return start + lines + end; +} + +const markdownExtensions = ["markdown", "mdown", "mkdn", "mkd", "md"]; + +export default Ember.Component.extend({ + isMarkdown : Ember.computed('path',function() { + const maybeExtension = this.get('path').split('.').pop(); + return markdownExtensions.any((extension) => (maybeExtension === extension)); + }), + html : Ember.computed('path','isMarkdown',function() { + if(this.get('isMarkdown')) { + return this.markdownConverter.makeHtml(this.get('text')); + } else { + return addLineNumbers(this.get('text')); + } + }), + init() { + this._super(...arguments); + this.markdownConverter = new showdown.Converter(); + }, + didInsertElement() { + const sourceCodeContainerElement = this.element.querySelector('.source-code-container'); + initializeLineSelection(sourceCodeContainerElement,this); + this.element.parentNode.scrollTop = 0; + }, + willDestroyElement : function () { + this.cleanup(); + }, + cleanup() { + if(this._onhashchange) { + window.removeEventListener('hashchange',this._onhashchange); + } + if(this._onkeydown) { + document.removeEventListener('keydown',this._onkeydown); + } + if(this._onkeyup) { + document.removeEventListener('keyup',this._onkeyup); + } + }, + pathObserver : Ember.observer('path',function() { + Ember.run.next(this,() => { + this.cleanup(); + this.didInsertElement(); + }); + }) +}); diff --git a/javascript/app/components/type-component.js b/javascript/app/components/type-component.js new file mode 100644 index 0000000..c19facc --- /dev/null +++ b/javascript/app/components/type-component.js @@ -0,0 +1,29 @@ +import Ember from 'ember'; +import {goToDefinition} from '../utils/go-to-definition'; + +export default Ember.Component.extend({ + store : Ember.inject.service('store'), + tagName : 'span', + classNames: ["type-component"], + contextMenu() {//right mouse button click to show kind of a type constructor or type variable + if(this.get('identifiers') && this.get('internalId')) { + this.set('expanded',true); + } + return false; + }, + linkClass : Ember.computed('identifierInfo',function() { + return this.get('identifierInfo') ? "link" : ""; + }), + identifierInfo : Ember.computed('internalId',function() { + return this.get('internalId') ? this.get('identifiers')[this.get('internalId')] : null; + }), + actions : { + onmouseup (event) { + if(this.get('identifierInfo') && (event.which !== 3 )) { + const locationInfo = this.get('identifierInfo').locationInfo; + goToDefinition(this.get('store'),locationInfo,event.which,this.get('currentLineNumber')); + return false; + } + } + } +}); diff --git a/javascript/app/components/type-signature-text.js b/javascript/app/components/type-signature-text.js new file mode 100644 index 0000000..e4eb200 --- /dev/null +++ b/javascript/app/components/type-signature-text.js @@ -0,0 +1,4 @@ +import Ember from 'ember'; +export default Ember.Component.extend({ + tagName : "span" +}); diff --git a/javascript/app/components/type-signature.js b/javascript/app/components/type-signature.js new file mode 100644 index 0000000..ed1849c --- /dev/null +++ b/javascript/app/components/type-signature.js @@ -0,0 +1,23 @@ +import Ember from 'ember'; +export default Ember.Component.extend({ + tagName : "span", + expandTypeSynonyms: false, + expandTypeSynonymsLabel : Ember.computed('expandTypeSynonyms',function() { + return this.get('expandTypeSynonyms') ? "Show type synonyms" : "Expand type synonyms"; + }), + components : Ember.computed('type','expandTypeSynonyms',function() { + if(this.get('expandTypeSynonyms') && this.get('type.componentsExpanded')) { + return this.get('type.componentsExpanded'); + } else { + return this.get('type.components'); + } + }), + typeObserver : Ember.observer('type',function() { + this.set('expandTypeSynonyms',false); + }), + actions : { + toggleExpandTypeSynonyms () { + this.toggleProperty('expandTypeSynonyms'); + } + } +}); diff --git a/javascript/app/controllers/application.js b/javascript/app/controllers/application.js new file mode 100644 index 0000000..2936011 --- /dev/null +++ b/javascript/app/controllers/application.js @@ -0,0 +1,21 @@ +import {updateColorThemeCss,themes} from '../utils/color-themes'; +import Ember from 'ember'; + +export default Ember.Controller.extend({ + settings : Ember.inject.service('settings'), + themes: Object.values(themes), + init() { + this._super(...arguments); + updateColorThemeCss(this.get('settings').get('colorTheme')); + }, + currentTheme: Ember.computed('settings',function() { + return this.get('settings.colorTheme.id'); + }), + actions : { + themeChanged (themeId) { + const theme = themes[themeId]; + this.get('settings').set('colorTheme',theme); + updateColorThemeCss(theme); + } + } +}); diff --git a/javascript/app/controllers/package.js b/javascript/app/controllers/package.js new file mode 100644 index 0000000..45a8bab --- /dev/null +++ b/javascript/app/controllers/package.js @@ -0,0 +1,24 @@ +import Ember from 'ember'; +import {goToDefinition} from '../utils/go-to-definition'; +export default Ember.Controller.extend({ + store : Ember.inject.service('store'), + currentFile : null, + loadItemsFunction : null, + query : null, + actions : { + searchIdentifier (query) { + if(query) { + this.set('currentFile',null); + document.title = this.get('model.id'); + this.transitionToRoute('package.search',query); + } + }, + showIdentifier (identifierInfo) { + goToDefinition(this.get('store'), + identifierInfo.locationInfo, + 1,//left mouse button + null); + return false; + } + } +}); diff --git a/javascript/app/controllers/package/index.js b/javascript/app/controllers/package/index.js new file mode 100644 index 0000000..cd02416 --- /dev/null +++ b/javascript/app/controllers/package/index.js @@ -0,0 +1,14 @@ +import Ember from 'ember'; +export default Ember.Controller.extend({ + modulesFiltered : Ember.computed('model','query',function () { + const query = this.get('query'); + const modules = Object.keys(this.get('model.modules')).sort(); + if(query) { + const regExp = new RegExp(query,"i"); + return modules.filter((p) => p.search(regExp) != -1); + } else { + return modules; + } + }) +}); + diff --git a/javascript/app/controllers/package/search.js b/javascript/app/controllers/package/search.js new file mode 100644 index 0000000..46f2efd --- /dev/null +++ b/javascript/app/controllers/package/search.js @@ -0,0 +1,15 @@ +import Ember from 'ember'; +import {goToDefinition} from '../../utils/go-to-definition'; + +export default Ember.Controller.extend({ + store : Ember.inject.service('store'), + actions : { + goToDefinition (locationInfo,event) { + goToDefinition(this.get('store'), + locationInfo, + event.which, + null); + return false; + } + } +}); diff --git a/javascript/app/controllers/package/show/file.js b/javascript/app/controllers/package/show/file.js new file mode 100644 index 0000000..c566e7e --- /dev/null +++ b/javascript/app/controllers/package/show/file.js @@ -0,0 +1,9 @@ +import Ember from 'ember'; +export default Ember.Controller.extend({ + settings : Ember.inject.service('settings'), + actions : { + findReferences(packageId,externalId,occName) { + this.send('updateReferences',packageId,externalId,occName); + } + } +}); diff --git a/javascript/app/controllers/packages.js b/javascript/app/controllers/packages.js new file mode 100644 index 0000000..a1724dd --- /dev/null +++ b/javascript/app/controllers/packages.js @@ -0,0 +1,12 @@ +import Ember from 'ember'; +export default Ember.Controller.extend({ + queryObserver : Ember.observer("query",function() { + Ember.run.debounce(this, () => { + const regExp = new RegExp(this.get('query'),"i"); + const packages = this.get('model').filter((p) => p.name.search(regExp) != -1); + Ember.run.next(() => { + this.set('packages',packages); + }); + }, 300); + }) +}); diff --git a/javascript/app/helpers/.gitkeep b/javascript/app/helpers/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/javascript/app/index.html b/javascript/app/index.html new file mode 100644 index 0000000..0c8f882 --- /dev/null +++ b/javascript/app/index.html @@ -0,0 +1,22 @@ + + + + + + Haskell code explorer + + + + {{content-for 'head'}} + + + {{content-for 'head-footer'}} + + + {{content-for 'body'}} + + + {{content-for 'body-footer'}} + + + diff --git a/javascript/app/router.js b/javascript/app/router.js new file mode 100644 index 0000000..f58e9ab --- /dev/null +++ b/javascript/app/router.js @@ -0,0 +1,20 @@ +import Ember from 'ember'; +import config from './config/environment'; + +var Router = Ember.Router.extend({ + location: config.locationType +}); + +Router.map(function() { + this.route('packages',{path:''}); + this.route('package', {path:'/package/:packageId'}, function() { + this.route('show',function() { + this.route('file', {path:'*filePath'}, function() { + }); + }); + this.route('search',{path:'/search/:query'}); + }); + this.route('bad-url', { path: '/*badurl' }); +}); + +export default Router; diff --git a/javascript/app/routes/application.js b/javascript/app/routes/application.js new file mode 100644 index 0000000..279bd32 --- /dev/null +++ b/javascript/app/routes/application.js @@ -0,0 +1,3 @@ +import Ember from 'ember'; +export default Ember.Route.extend({ +}); diff --git a/javascript/app/routes/package.js b/javascript/app/routes/package.js new file mode 100644 index 0000000..92fea03 --- /dev/null +++ b/javascript/app/routes/package.js @@ -0,0 +1,38 @@ +import Ember from 'ember'; +import {urls} from '../utils/api-urls'; + +export default Ember.Route.extend({ + store : Ember.inject.service('store'), + model (params) { + return this.get('store').loadPackage(params.packageId) + .catch((e) => {console.log(e);this.transitionTo("/package-not-found");}); + }, + afterModel(model) { + document.title = model.id; + }, + setupController(controller, model) { + this._super(controller, model); + const packageId = this.modelFor('package').id; + controller.set('bottomPanelVisible',false); + controller.set('createSearchUrlFunction',(query) => { + return urls.identifierSearchUrl(packageId,query); + }); + }, + actions : { + openFile (filePath) { + this.transitionTo('package.show.file',filePath); + }, + fileOpened (filePath) { + if(this.get('controller')) { + this.set('controller.currentFile',filePath); + } + }, + updateReferences(packageId,externalId,occName) { + this.set('controller.packageId',packageId); + this.set('controller.externalId',externalId); + this.set('controller.occName',occName); + this.set('controller.bottomPanelVisible',true); + this.set('controller.referencesUrl',urls.referencesUrl(packageId,externalId)+"?per_page=50"); + } + } +}); diff --git a/javascript/app/routes/package/index.js b/javascript/app/routes/package/index.js new file mode 100644 index 0000000..e36abd5 --- /dev/null +++ b/javascript/app/routes/package/index.js @@ -0,0 +1,7 @@ +import Ember from 'ember'; + +export default Ember.Route.extend({ + afterModel : function (model,transition) { + transition.send("fileOpened",null); + } +}); diff --git a/javascript/app/routes/package/search.js b/javascript/app/routes/package/search.js new file mode 100644 index 0000000..7bc711b --- /dev/null +++ b/javascript/app/routes/package/search.js @@ -0,0 +1,36 @@ +import Ember from 'ember'; +import {urls} from '../../utils/api-urls'; +import {goToDefinition} from '../../utils/go-to-definition'; + +export default Ember.Route.extend({ + store : Ember.inject.service('store'), + model (params) { + return { + query: params.query, + url: urls.identifierSearchUrl(this.modelFor('package').id,params.query)+"?per_page=20" + }; + }, + afterModel () { + const onmouseup = (event) => { + // This makes links in documentation clickable + if(event.target.dataset.location) { + let location; + try { + location = JSON.parse(event.target.dataset.location); + } catch (e) { + console.log(e); + } + if(location) { + goToDefinition(this.get('store'),location,event.which); + } + } + }; + this._onmouseup = onmouseup; + document.addEventListener('mouseup',onmouseup); + }, + deactivate() { + if(this._onmouseup) { + document.removeEventListener('mouseup',this._onmouseup); + } + } +}); diff --git a/javascript/app/routes/package/show/file.js b/javascript/app/routes/package/show/file.js new file mode 100644 index 0000000..ead6ee8 --- /dev/null +++ b/javascript/app/routes/package/show/file.js @@ -0,0 +1,27 @@ +import Ember from 'ember'; + +export default Ember.Route.extend({ + store : Ember.inject.service(), + model : function (params) { + const packageInfo = this.modelFor('package'); + if(packageInfo.modules[params.filePath]) { + return this.get('store').loadHaskellModule(packageInfo.id,params.filePath) + .catch((e) => {console.log(e);this.transitionTo("/not-found");}); + } else { + return this.get('store').loadFile(packageInfo.id,params.filePath) + .then((result) => { + document.title = packageInfo.id; + return result; + }) + .catch((e) => {console.log(e);this.transitionTo("/not-found");}); + } + }, + afterModel (model) { + document.title = model.id + " - " + this.modelFor('package').id; + }, + actions : { + didTransition : function () { + this.send("fileOpened",this.currentModel.id); + } + } +}); diff --git a/javascript/app/routes/package/show/index.js b/javascript/app/routes/package/show/index.js new file mode 100644 index 0000000..e36abd5 --- /dev/null +++ b/javascript/app/routes/package/show/index.js @@ -0,0 +1,7 @@ +import Ember from 'ember'; + +export default Ember.Route.extend({ + afterModel : function (model,transition) { + transition.send("fileOpened",null); + } +}); diff --git a/javascript/app/routes/packages.js b/javascript/app/routes/packages.js new file mode 100644 index 0000000..2bbf9bc --- /dev/null +++ b/javascript/app/routes/packages.js @@ -0,0 +1,16 @@ +import Ember from 'ember'; +import {urls} from '../utils/api-urls'; +import config from '../config/environment'; + +export default Ember.Route.extend({ + model () { + return Ember.$.getJSON(urls.packagesUrl); + }, + setupController(controller, model) { + this._super(controller, model); + controller.set('packages',model); + }, + afterModel () { + document.title = config.APP.title; + } +}); diff --git a/javascript/app/services/settings.js b/javascript/app/services/settings.js new file mode 100644 index 0000000..a79779a --- /dev/null +++ b/javascript/app/services/settings.js @@ -0,0 +1,21 @@ +import Ember from 'ember'; +import {themes} from '../utils/color-themes'; + +export default Ember.Service.extend({ + init() { + this._super(...arguments); + if(localStorage) { + const colorThemeId = localStorage.getItem("colorThemeId"); + const colorTheme = themes[colorThemeId]; + if(colorThemeId) { + this.set('colorTheme',colorTheme); + } + } + }, + colorTheme : themes["darkTheme"], + settingsObserver : Ember.observer("colorTheme",function() { + if(localStorage) { + localStorage.setItem("colorThemeId",this.get('colorTheme').id); + } + }) +}); diff --git a/javascript/app/services/store.js b/javascript/app/services/store.js new file mode 100644 index 0000000..cf48f9d --- /dev/null +++ b/javascript/app/services/store.js @@ -0,0 +1,141 @@ +import Ember from 'ember'; +import RSVP from 'rsvp'; +import {urls} from '../utils/api-urls'; + + +//******************************************************************************** +//https://coderwall.com/p/zrlulq/parsing-a-link-header-in-javascript +function unquote(value) { + if (value.charAt(0) == '"' && value.charAt(value.length - 1) == '"') { + return value.substring(1, value.length - 1); + } else { + return value; + } +} + +function parseLinkHeader(header) { + if(!header) {return {}} + var linkexp = /<[^>]*>\s*(\s*;\s*[^\(\)<>@,;:"\/\[\]\?={} \t]+=(([^\(\)<>@,;:"\/\[\]\?={} \t]+)|("[^"]*")))*(,|$)/g; + var paramexp = /[^\(\)<>@,;:"\/\[\]\?={} \t]+=(([^\(\)<>@,;:"\/\[\]\?={} \t]+)|("[^"]*"))/g; + + var matches = header.match(linkexp); + var rels = new Object(); + for (let i = 0; i < matches.length; i++) { + var split = matches[i].split('>'); + var href = split[0].substring(1); + var ps = split[1]; + var link = new Object(); + link.href = href; + var s = ps.match(paramexp); + for (let j = 0; j < s.length; j++) { + var p = s[j]; + var paramsplit = p.split('='); + var name = paramsplit[0]; + link[name] = unquote(paramsplit[1]); + } + + if (link.rel != undefined) { + rels[link.rel] = link; + } + } + return rels; +} +//******************************************************************************** + + +export default Ember.Service.extend({ + init() { + this.packages = {}; + this.files = {}; + this.haskellModules = {}; + this.definitionSites = {}; + this.modulePaths = {}; + this.expressions = {}; + this.references = {}; + }, + loadPackage(packageId) { + const packageInfo = this.packages[packageId]; + if(packageInfo) { + return new RSVP.Promise((resolve) => {resolve(packageInfo);}); + } else { + const url = urls.packageInfoUrl(packageId); + return Ember.$.getJSON(url).then((packageInfo) => { + this.packages[packageId] = packageInfo; + return packageInfo; + }); + } + }, + loadFile(packageId,filePath) { + const fileId = packageId + "/" + filePath; + const file = this.files[fileId]; + if(file) { + return new RSVP.Promise((resolve) => {resolve(file);}); + } else { + const url = urls.fileUrl(packageId,filePath); + return Ember.$.get({url:url,dataType:"text"}).then((text) => { + const file = {}; + file.text = text; + file.packageId = packageId; + file.isHaskellModule = false; + file.id = filePath; + this.files[fileId] = file; + return file; + }); + } + }, + loadHaskellModule(packageId,filePath) { + const moduleId = packageId + "/" + filePath ; + const module = this.haskellModules[moduleId]; + if(module) { + return new RSVP.Promise((resolve)=>{resolve(module);}); + } else { + const url = urls.haskellModuleUrl(packageId,filePath); + return Ember.$.getJSON(url).then((module) => { + module.packageId = packageId; + module.isHaskellModule = true; + this.haskellModules[moduleId] = module; + return module; + }); + } + }, + loadDefinitionSite(packageId,moduleName,componentId,entity,name) { + const id = packageId + "/"+ componentId + "/" + moduleName + "/" + entity + "/" + name; + const definitionSite = this.definitionSites[id]; + if(definitionSite) { + return new RSVP.Promise((resolve)=>{resolve(definitionSite);}); + } else { + const url = urls.identifierDefinitionSiteUrl(packageId,moduleName,componentId,entity,name); + return Ember.$.getJSON(url).then((definitionSite) => { + this.definitionSites[id] = definitionSite; + return definitionSite; + }); + } + }, + loadExpressions(packageId,modulePath,lineStart,columnStart,lineEnd,columnEnd) { + const id = packageId + "/" + encodeURIComponent(modulePath) + + "/" + lineStart + "/" + columnStart + "/" + lineEnd + "/" + columnEnd; + const exprs = this.expressions[id]; + if(exprs) { + return new RSVP.Promise((resolve)=>{resolve(exprs);}); + } else { + const url = urls.expressionsUrl(packageId,modulePath,lineStart,columnStart,lineEnd,columnEnd); + return Ember.$.getJSON(url).then((exprs) => { + this.expressions[id] = exprs; + return exprs; + }); + } + }, + loadFromUrlPaginated(url) { + return Ember.$.getJSON(url).then((items,textStatus,jqXHR) => { + const linkHeaderText = jqXHR.getResponseHeader('Link'); + const totalCountHeaderText = jqXHR.getResponseHeader('x-total-count'); + const linkHeader = parseLinkHeader(linkHeaderText); + const total = parseInt(totalCountHeaderText); + return { + items:items, + total:total, + linkHeader:linkHeader + }; + }); + } +}); diff --git a/javascript/app/styles/app.scss b/javascript/app/styles/app.scss new file mode 100644 index 0000000..f094187 --- /dev/null +++ b/javascript/app/styles/app.scss @@ -0,0 +1,555 @@ +@import "ember-cli-bootstrap-4/bootstrap"; + +body { + font-size:14px; +} + +a, a:visited, a:focus, a:active, a:hover{ + outline:0 none; +} + +input:focus{ + outline:none; +} + +p { + margin-top:1rem; +} + +.ember-radio-button { + cursor:pointer; +} + +label { + margin-bottom:0px; +} + +ul { + list-style: none; + padding : 0; +} + +ol { + list-style: none; + padding : 0; +} + +li { + list-style: none; +} + +.documentation { + margin-top:10px; + li { + list-style: disc outside none; + } + ul { + padding-left:15px; + } + ol { + padding-left:15px; + } +} + +.flex-container { + display:flex; + flex-direction:column; + height:100%; + width:100%; +} + +.absolute-container { + position:absolute; + top:0; + bottom:0; + left:0; + right:0; +} + +.header { + flex: none; + padding:5px; + img { + float:left; + } +} + +.header-item { + display:inline-block; + margin-top:5px; + font-size : 1rem; + margin-right: 40px; + white-space: nowrap; + @media screen and (max-width: 700px) { + margin-right: 10px; + margin-left: 10px; + } +} + +.content { + flex: auto; + position:relative; + overflow:auto; +} + +.packages { + flex:auto; + overflow-y:auto; + li { + margin-bottom: 5px; + } + a { + margin-right:5px; + } +} + +.package-content { + flex:auto; + position:relative; +} + +.package-header { + padding:5px; +} + +.package-header-input { + display:inline-block; + margin-right:10px; +} + +.package-modules { + margin-left:10px; +} + +.module-name { + font-size:0.7rem; +} + +.package-search-form { + max-width:500px; + margin-bottom:10px; + margin-top:20px; +} + +.package-header-filename { + white-space: nowrap; +} + +.package-header-package-name { + margin-right:10px; + font-size:17px; +} + +.module-search-input { + max-width:500px; + margin:5px; +} + +ul.modules { + position:absolute; + top:50px; + bottom:0px; + margin:0px; + padding-left:15px; + left:0px; + right:0px; + display:flex; + flex-direction: column; + flex-wrap: wrap; + li { + margin-right: 10px; + } + overflow-x:auto; +} + +.left-panel { + position: absolute; + bottom : 0; + top : 0; + left : 0; + width : 300px; +} + +.show-left-panel-button { + position:absolute; + top:0px; + right:-20px; + z-index:2; + width:20px; + height:20px; + text-align:center; + vertical-align:middle; + a { + text-decoration:none; + } + opacity:0.6; + display:none; +} + +.show-left-panel-button:hover { + opacity:1; + cursor:pointer; +} + +.hide-file-tree { + position: relative; + top: 8px; + left: 3px; +} + +.hide-declarations { + margin:7px; +} + +.right-panel { + position: absolute; + bottom : 0; + top : 0; + right : 0; + left : 300px; + overflow-x: auto; + overflow-y: auto; +} + +.file-tree-container { + overflow-x: hidden; + overflow-y: auto; + position: absolute; + bottom : 0; + top : 0; + left: 0; + right: 0; +} + +.file-container { + position: absolute; + bottom : 0px; + top : 0; + right : 0; + left : 0; + overflow-x: auto; + overflow-y: auto; +} + +.bottom-panel { + display:none; + position: absolute; + bottom : 0; + right : 0; + left : 0; + overflow-x: auto; + overflow-y: auto; + z-index:4; +} + +.bottom-panel-header { + position: absolute; + top: 0; + right : 0; + left : 0; + height: 35px; + padding: 5px; +} + +.bottom-panel-content { + position: absolute; + bottom : 0; + top : 35px; + right : 0; + left : 0; + overflow-x: auto; + overflow-y: auto; +} + +.bottom-panel-header-options { + float:right; +} + +.bottom-panel-header-content { + white-space:nowrap; +} + +.highlighted-identifier { + border-radius: 3px; + box-shadow: 0 0 0 1px #B4B4B4; +} + +.identifier { + cursor:pointer; +} + +td.line-number { + cursor:pointer; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + width: 1%; + min-width: 60px; + text-align: left; + padding-left:10px; + opacity: 0.8; +} + +td.line-number:hover { + opacity : 1; +} + +td.line-content { + padding-left:5px; + +} + +$source-code-font:Consolas, Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace, serif; + +.source-code { + font-family: $source-code-font; + white-space:pre; + line-height:1.25; + tab-size: 4; +} + +.break-word { + word-wrap:break-word; +} + +code,pre { + font-family: $source-code-font !important; + white-space:pre; + line-height:1.25; + font-size:100%; + color : unset; +} + +.source-code-font { + font-family: $source-code-font; + line-height:1.25; +} + +.source-code-snippet { + padding: 4px; + text-decoration:none !important; + display:block; +} + +.source-code-snippet > b { + border-radius: 3px; + border: 1px solid #B4B4B4; + margin: -1px; +} + +.source-code-snippet:hover { + text-decoration:none; +} + +.source-code-container { + margin : 5px; +} + +.declarations { + position:fixed; + top:150px; + right:15px; + width: 450px; + z-index:1; + div { + margin : 5px; + } +} + +.declarations-header { + opacity:0.9; + height:50px; +} + +.declarations-content { + opacity:0.9; + position:absolute; + top:50px; + left:0px; + right:0px; + max-height:500px; + overflow-y:auto; + overflow-x:hidden; +} + +@media screen and (max-width: 1500px) { + .declarations { + display:none; + } +} + +.info-window-container { + position:absolute; + width:750px; + z-index:10; +} + +.info-window-header { + margin:5px; + width: 100%; + cursor: move; + cursor: grab; + cursor: -moz-grab; + cursor: -webkit-grab; +} + +.info-window-content { + max-height:200px; + overflow-x:auto; + overflow-y:auto; +} + +.info-window-options { + margin-right:10px; + margin-left:10px; + float:right; +} + + +.ui-draggable-dragging .info-window-header { + cursor: grabbing; + cursor: -moz-grabbing; + cursor: -webkit-grabbing; +} + +span.link { + cursor:pointer; + white-space:nowrap; +} + +span.link:hover { + text-decoration:underline; +} + +.ui-resizable-n { + height: 13px !important;; +} + +.ui-resizable-w { + width: 13px !important;; +} + +.type-info { + padding-top: 5px; + padding-bottom: 5px; +} + +.type-component { + display: inline-block; +} + +dd { + margin-left: 1em; +} + +.autocomplete-container { + position:absolute; + z-index:10; + display:none; + left:0px; +} + +ul.autocomplete-items { + li { + cursor:pointer; + max-height: 200px; + overflow: hidden; + } +} + +.autocomplete-item { + padding:5px; +} + +.file-tree-header { + position:absolute; + top:0; + left:0; + right:0; + height:50px; + margin:5px; +} + +.file-tree-content { + position:absolute; + top:50px; + left:0; + right:0; + bottom:0; + overflow-x:auto; + overflow-x:auto; +} + +button { + color:black; +} + +.paginated-list-header { + position:absolute; + top:0px; + left:0px; + right:0px; + height:40px; + padding: 5px; + white-space:nowrap; +} + +.paginated-list-content { + position:absolute; + top:40px; + bottom:0px; + left:0px; + right:0px; + overflow:auto; +} + +.pagination-button { + font-size: 10px; +} + +.search-results-header { + position:absolute; + top:0px; + left:0px; + right:0px; + height:35px; + padding: 5px; + white-space:nowrap; +} + +.search-results-content { + position:absolute; + top:35px; + bottom:0px; + left:0px; + right:0px; +} + +.search-result { + padding:5px; +} + +.expression { + margin-bottom:15px; +} + +.expressions { + margin:5px; +} + +.file-name { + margin-left:5px; +} + +.identifier-info { + margin:5px; +} + +.identifier-module { + margin-top:10px; +} + +.identifier-menu-item { + margin-right:10px; +} diff --git a/javascript/app/templates/application.hbs b/javascript/app/templates/application.hbs new file mode 100644 index 0000000..bd64fdb --- /dev/null +++ b/javascript/app/templates/application.hbs @@ -0,0 +1,26 @@ +
+
+
+ +
+ {{#link-to 'packages'}}Haskell packages{{/link-to}} + About + + {{#each themes as |theme|}} + {{#radio-button + value=theme.id + groupValue=currentTheme + changed="themeChanged"}} + {{theme.name}} + {{/radio-button}} + {{/each}} + +
+
+
+
+ {{outlet}} +
+
+
+
diff --git a/javascript/app/templates/bad-url.hbs b/javascript/app/templates/bad-url.hbs new file mode 100644 index 0000000..6b36386 --- /dev/null +++ b/javascript/app/templates/bad-url.hbs @@ -0,0 +1,6 @@ +
+
+

Not found

+
Main page
+
+
diff --git a/javascript/app/templates/components/.gitkeep b/javascript/app/templates/components/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/javascript/app/templates/components/bottom-panel.hbs b/javascript/app/templates/components/bottom-panel.hbs new file mode 100644 index 0000000..26b1919 --- /dev/null +++ b/javascript/app/templates/components/bottom-panel.hbs @@ -0,0 +1,9 @@ +
+ {{yield "header"}} + + Close + +
+
+ {{yield "body"}} +
diff --git a/javascript/app/templates/components/expression-info.hbs b/javascript/app/templates/components/expression-info.hbs new file mode 100644 index 0000000..509fb24 --- /dev/null +++ b/javascript/app/templates/components/expression-info.hbs @@ -0,0 +1,8 @@ +
+ {{#each expressions as |expression|}} +
+ {{expression.sourceCode}} +
:: {{type-signature type=expression.info.exprType identifiers=identifiers currentLineNumber=currentLineNumber}} +
+ {{/each}} +
diff --git a/javascript/app/templates/components/file-tree.hbs b/javascript/app/templates/components/file-tree.hbs new file mode 100644 index 0000000..b5e38ef --- /dev/null +++ b/javascript/app/templates/components/file-tree.hbs @@ -0,0 +1,8 @@ +
+
+ {{input class="form-control" value=query placeholder="Filename"}}Hide +
+
+
+
+
diff --git a/javascript/app/templates/components/haskell-module.hbs b/javascript/app/templates/components/haskell-module.hbs new file mode 100644 index 0000000..77b9df7 --- /dev/null +++ b/javascript/app/templates/components/haskell-module.hbs @@ -0,0 +1,57 @@ +
+{{#if declarations}} +
+
+
+ {{input class="form-control" value=query placeholder="Identifier"}}{{showDeclarationsLabel}} +
+
+ {{#if showDeclarations}} +
+ +
+ {{/if}} +
+{{/if}} +{{#info-window + targetElement=selectedIdentifier + isHoveredOverIdentifier=isHoveredOverIdentifier + hasSelectedExpression=hasSelectedExpression + containerElementId="right-panel" as |section|}} + {{#if (eq section "header")}} + {{#if hasSelectedExpression}} +
Selected expressions
+ {{else}} + {{identifier-name + identifierInfo=identifierInfo + identifierOccurrence=identifierOccurrence + identifierElement=selectedIdentifier + currentPackageId=packageId + isBinder=identifierOccurrence.isBinder + currentLineNumber=currentLineNumber + findReferences=findReferences}} + {{/if}} + {{else}} + {{#unless hasSelectedExpression}} + {{identifier-info + identifierInfo=identifierInfo + identifierOccurrence=identifierOccurrence + identifiers=identifiers + currentLineNumber=currentLineNumber}} + {{else}} + {{expression-info + expressions=expressions + identifiers=identifiers + currentLineNumber=currentLineNumber}} + {{/unless}} + {{/if}} +{{/info-window}} diff --git a/javascript/app/templates/components/identifier-info.hbs b/javascript/app/templates/components/identifier-info.hbs new file mode 100644 index 0000000..7146a2e --- /dev/null +++ b/javascript/app/templates/components/identifier-info.hbs @@ -0,0 +1,39 @@ +{{#if (or identifierInfo identifierOccurrence.idOccType)}} +
+ {{#if identifierInfo}} + {{#if isNaughtyRecSel}} + This record selector can never be called because its type mentions a type variable that isn't in the result type of the constructor + {{else}} + {{type-signature + type=identifierInfo.idType + identifiers=identifiers + currentLineNumber=currentLineNumber}} + {{/if}} + {{/if}} + {{#if (and identifierInfo identifierOccurrence identifierOccurrence.idOccType)}} +
+ {{/if}} + {{#if (and identifierOccurrence identifierOccurrence.idOccType)}} + {{type-signature + type=identifierOccurrence.idOccType + identifiers=identifiers + currentLineNumber=currentLineNumber}} + {{/if}} +
+ {{{identifierInfo.doc}}} + {{{downloadedDocumentation}}} +
+ {{#if identifierOccurrence.instanceResolution}} +
+ {{/if}} +
+ {{#if identifierOccurrence.instanceResolution}} + {{instance-info + instance=identifierOccurrence.instanceResolution + identifiers=identifiers + nestedLevel=0 + currentLineNumber=currentLineNumber}} + {{/if}} +
+
+{{/if}} diff --git a/javascript/app/templates/components/identifier-name.hbs b/javascript/app/templates/components/identifier-name.hbs new file mode 100644 index 0000000..ca16e23 --- /dev/null +++ b/javascript/app/templates/components/identifier-name.hbs @@ -0,0 +1,12 @@ +
+ {{#if identifierInfo.demangledOccName}}{{identifierInfo.demangledOccName}}{{else}}{{name}}{{/if}} + {{#unless isBinder}} + {{#if location}} + {{location}} + Go to definition + {{/if}} + {{/unless}} + {{#if isExternalIdentifier}} + Find references + {{/if}} +
diff --git a/javascript/app/templates/components/infinite-list.hbs b/javascript/app/templates/components/infinite-list.hbs new file mode 100644 index 0000000..ab103d4 --- /dev/null +++ b/javascript/app/templates/components/infinite-list.hbs @@ -0,0 +1,3 @@ +{{#each renderedElements as |element|}} + {{yield element}} +{{/each}} diff --git a/javascript/app/templates/components/info-window.hbs b/javascript/app/templates/components/info-window.hbs new file mode 100644 index 0000000..003e2c5 --- /dev/null +++ b/javascript/app/templates/components/info-window.hbs @@ -0,0 +1,12 @@ +
+
+ + {{yield "header"}} +
+
+ {{yield "body"}} +
+
diff --git a/javascript/app/templates/components/input-with-autocomplete.hbs b/javascript/app/templates/components/input-with-autocomplete.hbs new file mode 100644 index 0000000..eb0100d --- /dev/null +++ b/javascript/app/templates/components/input-with-autocomplete.hbs @@ -0,0 +1,19 @@ +
+ {{input class="form-control search-input" value=query placeholder=placeholder}} +
+ {{# if items}} +
    + {{#each items as |item index|}} +
  • +
    + {{yield item}} +
    +
  • + {{/each}} +
+ {{/if}} +
+
+ +
+
diff --git a/javascript/app/templates/components/instance-info.hbs b/javascript/app/templates/components/instance-info.hbs new file mode 100644 index 0000000..b5c2fdf --- /dev/null +++ b/javascript/app/templates/components/instance-info.hbs @@ -0,0 +1,10 @@ +{{#if instance}} +
+ + instance {{type-signature type=instance.instanceType identifiers=identifiers currentLineNumber=currentLineNumber noExpand=true}} + (Go to definition) + {{#each instance.instances as |inst|}} + {{instance-info instance=inst identifiers=identifiers nestedLevel=nextNestedLevel currentLineNumber=currentLineNumber}} + {{/each}} +
+{{/if}} diff --git a/javascript/app/templates/components/paginated-list.hbs b/javascript/app/templates/components/paginated-list.hbs new file mode 100644 index 0000000..2ae9813 --- /dev/null +++ b/javascript/app/templates/components/paginated-list.hbs @@ -0,0 +1,17 @@ +
+ Found {{total}} + {{#if (or next prev)}} +   +   + + {{#if first}}{{/if}} + {{#if prev}}{{/if}} + {{firstItemOnPage}} - {{lastItemOnPage}} + {{#if next}}{{/if}} + {{#if last}}{{/if}} + + {{/if}} +
+
+ {{yield items}} +
diff --git a/javascript/app/templates/components/resizable-panel.hbs b/javascript/app/templates/components/resizable-panel.hbs new file mode 100644 index 0000000..0fd3aa7 --- /dev/null +++ b/javascript/app/templates/components/resizable-panel.hbs @@ -0,0 +1,5 @@ +
{{yield (action "hide")}} +
+ {{{hideButtonLabel}}} +
+
diff --git a/javascript/app/templates/components/text-file.hbs b/javascript/app/templates/components/text-file.hbs new file mode 100644 index 0000000..6a50453 --- /dev/null +++ b/javascript/app/templates/components/text-file.hbs @@ -0,0 +1,3 @@ +
+{{{html}}} +
diff --git a/javascript/app/templates/components/type-component.hbs b/javascript/app/templates/components/type-component.hbs new file mode 100644 index 0000000..775324e --- /dev/null +++ b/javascript/app/templates/components/type-component.hbs @@ -0,0 +1,3 @@ +{{#if (and expanded identifierInfo)}}({{/if}} +{{occName}} +{{#if (and expanded identifierInfo)}} :: {{type-signature type=identifierInfo.idType identifiers=identifiers noExpand=true}}){{/if}} diff --git a/javascript/app/templates/components/type-signature-text.hbs b/javascript/app/templates/components/type-signature-text.hbs new file mode 100644 index 0000000..505a466 --- /dev/null +++ b/javascript/app/templates/components/type-signature-text.hbs @@ -0,0 +1,2 @@ +{{!-- No newlines to get rid of spaces between spans --}} +{{#each components as |typeComponent|}}{{#if (eq typeComponent.tag "Text")}}{{typeComponent.contents}}{{else}}{{typeComponent.name}}{{/if}}{{/each}} diff --git a/javascript/app/templates/components/type-signature.hbs b/javascript/app/templates/components/type-signature.hbs new file mode 100644 index 0000000..249f1b8 --- /dev/null +++ b/javascript/app/templates/components/type-signature.hbs @@ -0,0 +1,10 @@ +{{!-- No newlines to get rid of spaces between spans --}} +{{#each components as |typeComponent|}}{{#if (eq typeComponent.tag "Text")}}{{typeComponent.contents}}{{else}}{{type-component occName=typeComponent.name internalId=typeComponent.internalId identifiers=identifiers currentLineNumber=currentLineNumber}}{{/if}}{{/each}} +{{#unless noExpand}} + {{#if type.componentsExpanded}} +
+ +
+ {{/if}} +{{/unless}} diff --git a/javascript/app/templates/package.hbs b/javascript/app/templates/package.hbs new file mode 100644 index 0000000..c8ed0dc --- /dev/null +++ b/javascript/app/templates/package.hbs @@ -0,0 +1,57 @@ +
+
+ {{#link-to 'package' model}}{{model.id}}{{/link-to}} + + {{#input-with-autocomplete + onSubmit=(action 'searchIdentifier') + createSearchUrlFunction=createSearchUrlFunction + maxItems=10 + selectItem=(action 'showIdentifier') + placeholder="Identifier" as |identifier|}} + {{identifier.demangledOccName}} :: {{type-signature-text components=identifier.idType.components}} +
+ {{#if identifier.locationInfo.modulePath}} + {{identifier.locationInfo.modulePath}} + {{else}} + {{identifier.locationInfo.moduleName}} + {{/if}} +
+ {{/input-with-autocomplete}} +
+ {{#if currentFile}} + + {{currentFile}} + + {{/if}} +
+
+ {{#resizable-panel class="left-panel" alsoResizeElementId="#right-panel" as |hide|}} +
+ {{file-tree directoryTree=model.directoryTree openFile="openFile" currentFile=currentFile packageId=model.id hide=hide}} +
+ {{/resizable-panel}} +
+
+ {{outlet}} +
+ {{#bottom-panel visible=bottomPanelVisible topPanelElementId="#file-container" containerElementId="#right-panel" as |section|}} + {{#if (eq section "header")}} + References to {{occName}} in {{packageId}} + {{else}} + {{#paginated-list url=referencesUrl as |files|}} + + {{/paginated-list}} + {{/if}} + {{/bottom-panel}} +
+
+
diff --git a/javascript/app/templates/package/index.hbs b/javascript/app/templates/package/index.hbs new file mode 100644 index 0000000..e9bc592 --- /dev/null +++ b/javascript/app/templates/package/index.hbs @@ -0,0 +1,12 @@ +
+
+ {{input class="form-control" type="text" value=query placeholder="Module name"}} +
+
    + {{#each modulesFiltered as |module|}} +
  • + {{module}} +
  • + {{/each}} +
+
diff --git a/javascript/app/templates/package/search.hbs b/javascript/app/templates/package/search.hbs new file mode 100644 index 0000000..ebc4d52 --- /dev/null +++ b/javascript/app/templates/package/search.hbs @@ -0,0 +1,21 @@ +
+ Query : {{model.query}} +
+
+ {{#paginated-list url=model.url as |identifiers|}} +
    + {{#each identifiers as |identifier|}} +
  • + {{identifier.demangledOccName}} :: {{type-signature-text components=identifier.idType.components}} + +
    + {{#if identifier.locationInfo.modulePath}} + Defined in {{identifier.locationInfo.modulePath}} + {{/if}} +
    +
    {{{identifier.doc}}}
    +
  • + {{/each}} +
+ {{/paginated-list}} +
diff --git a/javascript/app/templates/package/show.hbs b/javascript/app/templates/package/show.hbs new file mode 100644 index 0000000..c24cd68 --- /dev/null +++ b/javascript/app/templates/package/show.hbs @@ -0,0 +1 @@ +{{outlet}} diff --git a/javascript/app/templates/package/show/file.hbs b/javascript/app/templates/package/show/file.hbs new file mode 100644 index 0000000..b127fd7 --- /dev/null +++ b/javascript/app/templates/package/show/file.hbs @@ -0,0 +1,16 @@ +{{#if model.isHaskellModule}} + {{haskell-module + path=model.id + name=model.name + packageId=model.packageId + componentId=model.componentId + html=model.sourceCodeHtml + identifiers=model.identifiers + occurrences=model.occurrences + colorTheme=settings.colorTheme + declarations=model.declarations + findReferences=(action "findReferences") + }} +{{else}} + {{text-file text=model.text path=model.id}} +{{/if}} diff --git a/javascript/app/templates/packages.hbs b/javascript/app/templates/packages.hbs new file mode 100644 index 0000000..6dc4b7b --- /dev/null +++ b/javascript/app/templates/packages.hbs @@ -0,0 +1,26 @@ +
+
+ +
+ {{input class="form-control" type="text" value=query placeholder="Package name"}} + Number of packages : {{packages.length}} +
+
+
+
    + {{#infinite-list containerElementId="packages" elements=packages perPage=80 as |package|}} +
  • + {{#each package.versions as |version index|}} + {{#link-to 'package' (concat package.name "-" version)}} + {{#if (gt index 0)}} + {{version}} + {{else}} + {{package.name}}-{{version}} + {{/if}} + {{/link-to}} + {{/each}} +
  • + {{/infinite-list}} +
+
+
diff --git a/javascript/app/utils/api-urls.js b/javascript/app/utils/api-urls.js new file mode 100644 index 0000000..b2748b6 --- /dev/null +++ b/javascript/app/utils/api-urls.js @@ -0,0 +1,29 @@ +import config from '../config/environment'; + +export const urls = { + packageInfoUrl : function(packageId) { + return config.APP.staticUrlPrefix+"/"+packageId+"/"+config.APP.haskellCodeExplorerDirectory+"/packageInfo.json"; + }, + fileUrl : function(packageId,filePath) { + return config.APP.staticUrlPrefix+"/"+packageId+"/"+filePath; + }, + haskellModuleUrl : function (packageId,filePath) { + return config.APP.staticUrlPrefix+"/"+packageId+"/"+config.APP.haskellCodeExplorerDirectory+"/"+encodeURIComponent(encodeURIComponent(filePath))+ ".json"; + }, + packagesUrl : config.APP.apiUrlPrefix + "/packages", + identifierDefinitionSiteUrl : function(packageId,moduleName,componentId,entity,name) { + return config.APP.apiUrlPrefix + "/definitionSite/" + packageId+"/"+componentId+"/"+moduleName+"/"+entity+"/"+encodeURIComponent(name).replace(/\./g, '%2E'); + }, + modulePathUrl : function (packageId,moduleName,componentId) { + return config.APP.apiUrlPrefix + "/modulePath/"+packageId+"/"+componentId+"/"+moduleName; + }, + expressionsUrl : function (packageId,modulePath,lineStart,columnStart,lineEnd,columnEnd) { + return config.APP.apiUrlPrefix + "/expressions/"+packageId+"/"+encodeURIComponent(modulePath) +"/"+lineStart+"/"+columnStart+"/"+lineEnd+"/"+columnEnd; + }, + referencesUrl : function (packageId,externalId) { + return config.APP.apiUrlPrefix + "/references/"+packageId+"/"+encodeURIComponent(externalId); + }, + identifierSearchUrl : function (packageId,query) { + return config.APP.apiUrlPrefix + "/identifiers/"+packageId+"/"+encodeURIComponent(query).replace(/\./g, '%2E'); + } +} diff --git a/javascript/app/utils/color-themes.js b/javascript/app/utils/color-themes.js new file mode 100644 index 0000000..0a563ff --- /dev/null +++ b/javascript/app/utils/color-themes.js @@ -0,0 +1,188 @@ +function colorThemeToCss(colorTheme) { + const css = ` + body { + color: ${colorTheme.defaultColor} !important; + background-color: ${colorTheme.backgroundColor} !important; + } + input { + color: ${colorTheme.defaultColor} !important; + background-color: ${colorTheme.backgroundColor} !important; + border-color: ${colorTheme.borderColor} !important; + } + .package-content { + border-top: 1px solid ${colorTheme.borderColor} !important; + } + .header a { + color : ${colorTheme.menuLinkColor} !important; + } + a { + color: ${colorTheme.typeColor} !important; + } + span.link { + color: ${colorTheme.typeColor} !important; + } + .header { + background-color: ${colorTheme.menuColor} !important; + border-bottom: 1px solid ${colorTheme.borderColor} !important; + } + .declarations-content { + background-color: ${colorTheme.navigationPanelColor} !important; + border: 1px solid ${colorTheme.borderColor} !important; + } + .declarations-header { + background-color: ${colorTheme.navigationPanelColor} !important; + border: 1px solid ${colorTheme.borderColor} !important; + } + li.declaration { + border-bottom: 1px solid ${colorTheme.borderColor} !important; + } + .left-panel { + background-color: ${colorTheme.navigationPanelColor} !important; + border-right: 1px solid ${colorTheme.borderColor} !important; + } + .show-left-panel-button { + background-color: ${colorTheme.navigationPanelColor} !important; + border-right:1px solid ${colorTheme.borderColor} !important; + border-bottom:1px solid ${colorTheme.borderColor} !important; + } + .right-panel { + background-color: ${colorTheme.backgroundColor} !important; + } + a.jstree-anchor { + color: ${colorTheme.defaultColor} !important; + } + .declaration > a { + color: ${colorTheme.defaultColor} !important; + } + .highlighted-line { + background : ${colorTheme.highlightedLineColor} !important; + } + table.source-code { + background-color: ${colorTheme.backgroundColor} !important; + color: ${colorTheme.defaultColor} !important; + } + .jstree-clicked { + background-color: ${colorTheme.backgroundColor} !important; + } + .jstree-hovered { + background-color: ${colorTheme.backgroundColor} !important; + } + ul.autocomplete-items { + background-color: ${colorTheme.backgroundColor} !important; + border-top: 1px solid ${colorTheme.borderColor} !important; + border-left: 1px solid ${colorTheme.borderColor} !important; + border-right: 1px solid ${colorTheme.borderColor} !important; + } + ul.autocomplete-items > li { + border-bottom: 1px solid ${colorTheme.borderColor} !important; + } + ul.autocomplete-items > li:hover { + background-color: ${colorTheme.highlightedLineColor} !important; + } + ul.autocomplete-items > li.highlighted { + background-color: ${colorTheme.highlightedLineColor} !important; + } + .source-code-snippet { + color: ${colorTheme.defaultColor} !important; + border-bottom: 1px solid ${colorTheme.borderColor} !important; + } + .source-code-snippet:hover { + background-color: ${colorTheme.highlightedLineColor} !important; + } + .bottom-panel { + background-color: ${colorTheme.backgroundColor} !important; + border-top: 1px solid ${colorTheme.borderColor} !important; + } + .bottom-panel-header { + border-bottom: 1px solid ${colorTheme.borderColor} !important; + } + .paginated-list-header { + border-bottom: 1px solid ${colorTheme.borderColor} !important; + } + li.search-result { + border-bottom: 1px solid ${colorTheme.borderColor} !important; + } + .search-results-header { + border-bottom: 1px solid ${colorTheme.borderColor} !important; + } + .info-window-content { + border-top: 1px solid ${colorTheme.borderColor} !important; + } + .info-window { + border: 1px solid ${colorTheme.borderColor} !important; + background-color:${colorTheme.infoWindowColor} !important; + color: ${colorTheme.defaultColor} !important; + } + .type-info { + border-top: 1px solid ${colorTheme.borderColor} !important; + }`; + return css; +} + +const darkTheme = { + id: "darkTheme", + name: "Dark theme", + description: "Dark theme (Monokai based)", + defaultColor: "#F8F8F2", + backgroundColor: "#272822", + typeColor: "#66D9EF", + literalColor: "#E6DB74", + topLevelIdFromCurrentModule : "#A6E22E", + localIdentifierColor: ["#F0A3FF","#0075DC","#993F00", + "#2BCE48","#FFCC99","#808080","#94FFB5","#8F7C00", + "#C20088","#FFA405","#FFA8BB","#426600","#FF0010", + "#5EF1F2","#00998F","#E0FF66","#FFFF80", + "#FFFF00","#FF5005"], + menuColor: "#3c3b37", + menuLinkColor : "#F8F8F2", + infoWindowColor: "#3c3b37", + navigationPanelColor: "#3c3b37", + linkColor : "#0366d6", + borderColor: "#535557", + highlightedLineColor: "#4a4a4a" +}; + +const lightTheme = { + id: "lightTheme", + name: "Light theme", + description: "Light theme (Github based)", + defaultColor: "#24292e", + backgroundColor: "#ffffff", + typeColor: "#005cc5", + literalColor: "#032f62", + topLevelIdFromCurrentModule : "#6f42c1", + localIdentifierColor: ["#005C31", + "#2BCE48","#808080","#8F7C00", + "#C20088","#FFA405","#ffa8bb","#426600","#FF0010", + "#09d7d8","#00998F","#990000","#FF5005"], + menuColor: "#f2f4f8", + menuLinkColor : "#24292e", + infoWindowColor: "#f2f4f8", + navigationPanelColor: "#f2f4f8", + linkColor : "#0366d6", + borderColor: "#e1e4e8", + highlightedLineColor: "#eaeaea" +}; + +function updateColorThemeCss (colorTheme) { + const newStyle = document.createElement('style'); + newStyle.type = 'text/css'; + newStyle.innerHTML = colorThemeToCss(colorTheme); + newStyle.id = 'color-theme'; + const oldStyle = document.querySelector("style#color-theme"); + if(oldStyle) { + oldStyle.parentElement.removeChild(oldStyle); + } + document.getElementsByTagName('head')[0].appendChild(newStyle); +} + +const themes = { + darkTheme: darkTheme, + lightTheme: lightTheme +}; + +export { + updateColorThemeCss, + colorThemeToCss, + themes +} diff --git a/javascript/app/utils/go-to-definition.js b/javascript/app/utils/go-to-definition.js new file mode 100644 index 0000000..e05f6bf --- /dev/null +++ b/javascript/app/utils/go-to-definition.js @@ -0,0 +1,95 @@ +function exactLocationToUrl(exactLocation) { + const modulePath = exactLocation.modulePath; + const packageId = exactLocation.packageId.name + "-" + exactLocation.packageId.version; + let hash = ""; + if(exactLocation.startLine != 1) { + hash = "#L" + exactLocation.startLine; + } + return "/package/"+packageId+"/show/"+modulePath+hash; +} + +function hackageUrl(packageId,locationInfo) { + const dasherizedModuleName = locationInfo.moduleName.replace(/\./g,'-'); + let key; + if(locationInfo.entity === "Val") { + key = "v"; + } else { + key = "t"; + } + let hash = ""; + if(locationInfo.entity === "Val" || locationInfo.entity === "Typ") { + hash = "#"+key+":"+locationInfo.haddockAnchorId; + } + return "https://hackage.haskell.org/package/"+packageId+"/docs/"+dasherizedModuleName+".html"+hash; +} + +function openUrl(buttonId,url) { + if(buttonId === 2) {//middle mouse button + window.open(url, '_blank'); + } else if(buttonId == 1) {//left mouse button + window.location = url; + } + return false; +} + +function saveCurrentLocation(currentLineNumber) { + if(currentLineNumber) { + const url = window.location.origin + window.location.pathname + "#L" + currentLineNumber; + if(location.href != url) { + window.location.hash = "#L" + currentLineNumber; + } + } +} + +function goToDefinition(store,locationInfo,buttonId,currentLineNumber) { + if(locationInfo.tag === "ExactLocation") { + const url = exactLocationToUrl(locationInfo); + if(locationInfo.startLine !== currentLineNumber) { + saveCurrentLocation(currentLineNumber); + } + openUrl(buttonId,url); + } else if(locationInfo.tag === "ApproximateLocation") { + const packageId = locationInfo.packageId.name+"-"+locationInfo.packageId.version; + if(locationInfo.entity === "Mod") { + store.loadDefinitionSite(packageId, + locationInfo.moduleName, + locationInfo.componentId, + locationInfo.entity, + locationInfo.moduleName) + .then((defSite) => { + const packageId = defSite.location.packageId.name + "-" + defSite.location.packageId.version; + openUrl(buttonId,"/package/" + packageId + "/show/" + defSite.location.modulePath); + }).catch(() => { + openUrl(buttonId,hackageUrl(packageId,locationInfo)); + }); + } else { + store.loadDefinitionSite(packageId, + locationInfo.moduleName, + locationInfo.componentId, + locationInfo.entity, + locationInfo.name) + .then((definitionSite) => { + if(definitionSite.location.tag === "ExactLocation") { + const url = exactLocationToUrl(definitionSite.location); + if(locationInfo.startLine !== currentLineNumber) { + saveCurrentLocation(currentLineNumber); + } + openUrl(buttonId,url); + } else { + saveCurrentLocation(currentLineNumber); + openUrl(buttonId,hackageUrl(packageId,locationInfo)); + } + }).catch((e) => { + console.log(e); + saveCurrentLocation(currentLineNumber); + openUrl(buttonId,hackageUrl(packageId,locationInfo)); + }); + } + } else { + alert('No location info'); + } +} + +export { + goToDefinition,openUrl +} diff --git a/javascript/app/utils/line-selection.js b/javascript/app/utils/line-selection.js new file mode 100644 index 0000000..d6d0976 --- /dev/null +++ b/javascript/app/utils/line-selection.js @@ -0,0 +1,111 @@ +function initializeLineSelection(sourceCodeContainerElement,component) { + const lineNumbers = Array.prototype.slice.call(sourceCodeContainerElement.querySelectorAll("td.line-number")); + if(lineNumbers.length > 0) { + const onhashchange = function () { + highlightSelectedLines(sourceCodeContainerElement); + } + window.addEventListener("hashchange",onhashchange); + component._onhashchange = onhashchange; + + let shiftPressed; + const onkeydown = function (event) { + if(event.keyCode === 16) { shiftPressed = true; } + }; + const onkeyup = function (event) { + if(event.keyCode === 16) { shiftPressed = false; } + }; + + document.addEventListener('keydown',onkeydown); + document.addEventListener('keyup',onkeyup); + component._onkeydown = onkeydown; + component._onkeyup = onkeyup; + + let selectedLine1,selectedLine2; + lineNumbers.forEach((lineNumberElement) => { + lineNumberElement.onclick = function() { + const number = parseInt(this.textContent); + if(shiftPressed && selectedLine1) { + if(selectedLine1 != number) { + selectedLine2 = number; + if(selectedLine1 < selectedLine2) { + highlightLines(sourceCodeContainerElement,selectedLine1,selectedLine2); + window.location.hash = "L"+selectedLine1+"-L"+selectedLine2; + } else { + highlightLines(sourceCodeContainerElement,selectedLine2,selectedLine1); + window.location.hash = "L"+selectedLine2+"-L"+selectedLine1; + } + } + } else { + selectedLine1 = number; + selectedLine2 = null; + highlightLines(sourceCodeContainerElement,selectedLine1,selectedLine1); + window.location.hash = "L"+number; + } + } + }); + const lines = highlightSelectedLines(sourceCodeContainerElement); + if(lines.length) { + selectedLine1 = lines[0]; + selectedLine2 = lines[1]; + } + } +} + +function highlightSelectedLines (sourceCodeContainerElement) { + const lineInfo = window.location.hash.slice(1); + if(lineInfo) { + if(lineInfo.includes('-')) { + const lines = lineInfo.split("-"); + const lineNumber1 = parseInt(lines[0].substring(1)); + const lineNumber2 = parseInt(lines[1].substring(1)); + if(lineNumber1 && lineNumber2 && lineNumber1 <= lineNumber2) { + highlightLines(sourceCodeContainerElement,lineNumber1,lineNumber2); + const line = sourceCodeContainerElement.querySelector("td#LC"+lineNumber1); + if(line) { + scrollLineIntoView(line,sourceCodeContainerElement); + } + return [lineNumber1,lineNumber2]; + } + } else { + const lineNumber = parseInt(lineInfo.substring(1)); + if(lineNumber) { + highlightLines(sourceCodeContainerElement,lineNumber,lineNumber); + const line = sourceCodeContainerElement.querySelector("td#LC"+lineNumber); + if(line) { + scrollLineIntoView(line,sourceCodeContainerElement); + } + return [lineNumber]; + } + } + } else { + highlightLines(sourceCodeContainerElement,0,0); + return []; + } +} + +function scrollLineIntoView(lineElement,sourceCodeContainerElement) { + lineElement.parentNode.scrollIntoView(); + const container = sourceCodeContainerElement.parentNode.parentNode; + const windowHeight = container.offsetHeight; + const fullHeight = sourceCodeContainerElement.offsetHeight; + + if(fullHeight - container.scrollTop > windowHeight) { + container.scrollTop = container.scrollTop - (windowHeight/2 - 20); + } +} + +function highlightLines(parentElement,startLine,endLine) { + const lineElements = Array.prototype.slice.call(parentElement.querySelectorAll("td.line-content")); + lineElements.forEach((lineElement) => { + const number = parseInt(lineElement.id.substring(2)); //... + if(number >= startLine && number <= endLine) { + lineElement.classList.add('highlighted-line'); + } else { + lineElement.classList.remove('highlighted-line'); + } + }); +} + +export { + initializeLineSelection,highlightLines,highlightSelectedLines +} diff --git a/javascript/bower.json b/javascript/bower.json new file mode 100644 index 0000000..9b3b4a5 --- /dev/null +++ b/javascript/bower.json @@ -0,0 +1,6 @@ +{ + "name": "haskell-code-explorer", + "dependencies": { + "pace": "^1.0.2" + } +} diff --git a/javascript/config/environment.js b/javascript/config/environment.js new file mode 100644 index 0000000..5e53024 --- /dev/null +++ b/javascript/config/environment.js @@ -0,0 +1,64 @@ +/* eslint-env node */ +'use strict'; + +module.exports = function(environment) { + let ENV = { + modulePrefix: 'haskell-code-explorer', + environment, + rootURL: '/', + locationType: 'auto', + EmberENV: { + FEATURES: { + // Here you can enable experimental features on an ember canary build + // e.g. 'with-controller': true + }, + EXTEND_PROTOTYPES: { + // Prevent Ember Data from overriding Date.parse. + Date: false + } + }, + pace: { + theme: 'minimal', + color: 'silver', + target: 'body', + elements: { + checkInterval: 100, + selectors: ['body', '.ember-view'] + }, + ajax: false + }, + APP: { + staticUrlPrefix: "/files", + apiUrlPrefix: "/api", + haskellCodeExplorerDirectory: ".haskell-code-explorer", + title: "Haskell code explorer" + } + }; + + if (environment === 'development') { + // ENV.APP.LOG_RESOLVER = true; + // ENV.APP.LOG_ACTIVE_GENERATION = true; + // ENV.APP.LOG_TRANSITIONS = true; + // ENV.APP.LOG_TRANSITIONS_INTERNAL = true; + // ENV.APP.LOG_VIEW_LOOKUPS = true; + } + + if (environment === 'test') { + // Testem prefers this... + ENV.locationType = 'none'; + + // keep test console output quieter + ENV.APP.LOG_ACTIVE_GENERATION = false; + ENV.APP.LOG_VIEW_LOOKUPS = false; + + ENV.APP.autoboot = false; + + ENV.APP.rootElement = '#ember-testing'; + } + + if (environment === 'production') { + + } + + return ENV; +}; diff --git a/javascript/config/targets.js b/javascript/config/targets.js new file mode 100644 index 0000000..df7664c --- /dev/null +++ b/javascript/config/targets.js @@ -0,0 +1,9 @@ +/* eslint-env node */ +module.exports = { + browsers: [ + 'ie 9', + 'last 1 Chrome versions', + 'last 1 Firefox versions', + 'last 1 Safari versions' + ] +}; diff --git a/javascript/ember-cli-build.js b/javascript/ember-cli-build.js new file mode 100644 index 0000000..0178882 --- /dev/null +++ b/javascript/ember-cli-build.js @@ -0,0 +1,21 @@ +/* eslint-env node */ +'use strict'; + +const EmberApp = require('ember-cli/lib/broccoli/ember-app'); + +module.exports = function(defaults) { + let app = new EmberApp(defaults, { + 'ember-cli-bootstrap-4': { + js: null + }, + 'ember-cli-babel': { + includePolyfill: true + } + }); + app.import('vendor/jquery-ui-1.12.1.custom/jquery-ui.min.js')// only draggable and resizable + app.import('vendor/jquery-ui-1.12.1.custom/jquery-ui.structure.min.css') + app.import('node_modules/jstree/dist/jstree.min.js'); + app.import('node_modules/jstree/dist/themes/default/style.min.css'); + app.import('node_modules/showdown/dist/showdown.min.js'); + return app.toTree(); +}; diff --git a/javascript/package.json b/javascript/package.json new file mode 100644 index 0000000..ce4f045 --- /dev/null +++ b/javascript/package.json @@ -0,0 +1,53 @@ +{ + "name": "haskell-code-explorer", + "version": "0.0.1", + "description": "Haskell code explorer", + "private": false, + "license": "MIT", + "author": "alexwl", + "directories": { + "doc": "doc", + "test": "tests" + }, + "repository": "", + "scripts": { + "build": "ember build --environment=production", + "release": "ember build --environment=production --output-path=release", + "start": "ember server" + }, + "devDependencies": { + "broccoli-asset-rev": "^2.4.5", + "ember-cli": "^3.2.0", + "ember-cli-app-version": "^3.0.0", + "ember-cli-babel": "^6.12.0", + "ember-cli-bootstrap-4": "^0.5.6", + "ember-cli-dependency-checker": "^1.3.0", + "ember-cli-eslint": "^4.2.1", + "ember-cli-htmlbars": "^2.0.1", + "ember-cli-htmlbars-inline-precompile": "^1.0.0", + "ember-cli-inject-live-reload": "^1.4.1", + "ember-cli-pace": "^0.1.0", + "ember-cli-qunit": "^4.1.1", + "ember-cli-sass": "^7.1.7", + "ember-cli-shims": "^1.1.0", + "ember-cli-sri": "^2.1.0", + "ember-cli-uglify": "^1.2.0", + "ember-export-application-global": "^2.0.0", + "ember-load-initializers": "^1.0.0", + "ember-radio-button": "^1.1.1", + "ember-resolver": "^4.0.0", + "ember-sinon": "^1.0.1", + "ember-sinon-qunit": "^2.0.0", + "ember-source": "3.2.0", + "ember-truth-helpers": "^2.0.0", + "express": "^4.16.2", + "glob": "^4.5.3", + "jstree": "3.3.5", + "loader.js": "^4.2.3", + "morgan": "^1.9.0", + "showdown": "^1.8.6" + }, + "engines": { + "node": "^4.5 || 6.* || >= 7.*" + } +} diff --git a/javascript/public/assets/32px.png b/javascript/public/assets/32px.png new file mode 100644 index 0000000..d6fd721 Binary files /dev/null and b/javascript/public/assets/32px.png differ diff --git a/javascript/public/assets/40px.png b/javascript/public/assets/40px.png new file mode 100644 index 0000000..4fc88e4 Binary files /dev/null and b/javascript/public/assets/40px.png differ diff --git a/javascript/public/assets/favicon.ico b/javascript/public/assets/favicon.ico new file mode 100644 index 0000000..37816fd Binary files /dev/null and b/javascript/public/assets/favicon.ico differ diff --git a/javascript/public/assets/haskell.ico b/javascript/public/assets/haskell.ico new file mode 100644 index 0000000..37816fd Binary files /dev/null and b/javascript/public/assets/haskell.ico differ diff --git a/javascript/public/assets/throbber.gif b/javascript/public/assets/throbber.gif new file mode 100644 index 0000000..cd75035 Binary files /dev/null and b/javascript/public/assets/throbber.gif differ diff --git a/javascript/public/robots.txt b/javascript/public/robots.txt new file mode 100644 index 0000000..f591645 --- /dev/null +++ b/javascript/public/robots.txt @@ -0,0 +1,3 @@ +# http://www.robotstxt.org +User-agent: * +Disallow: diff --git a/javascript/release/assets/32px-eebaf260766f5e0e773f53d3ea4f3e4d.png b/javascript/release/assets/32px-eebaf260766f5e0e773f53d3ea4f3e4d.png new file mode 100644 index 0000000..d6fd721 Binary files /dev/null and b/javascript/release/assets/32px-eebaf260766f5e0e773f53d3ea4f3e4d.png differ diff --git a/javascript/release/assets/40px-51286e68b083696edaf4f9fc577e2a2d.png b/javascript/release/assets/40px-51286e68b083696edaf4f9fc577e2a2d.png new file mode 100644 index 0000000..4fc88e4 Binary files /dev/null and b/javascript/release/assets/40px-51286e68b083696edaf4f9fc577e2a2d.png differ diff --git a/javascript/release/assets/favicon.ico b/javascript/release/assets/favicon.ico new file mode 100644 index 0000000..37816fd Binary files /dev/null and b/javascript/release/assets/favicon.ico differ diff --git a/javascript/release/assets/haskell-code-explorer-132e5ea09a5eb8889a4b7fe11ee25e98.js b/javascript/release/assets/haskell-code-explorer-132e5ea09a5eb8889a4b7fe11ee25e98.js new file mode 100644 index 0000000..36bba99 --- /dev/null +++ b/javascript/release/assets/haskell-code-explorer-132e5ea09a5eb8889a4b7fe11ee25e98.js @@ -0,0 +1,204 @@ +"use strict" +define("haskell-code-explorer/app",["exports","ember-resolver","ember-load-initializers","haskell-code-explorer/config/environment"],function(e,t,n,o){Object.defineProperty(e,"__esModule",{value:!0}) +var r +r=Ember.Application.extend({modulePrefix:o.default.modulePrefix,Resolver:t.default}),(0,n.default)(r,o.default.modulePrefix),e.default=r}),define("haskell-code-explorer/components/bottom-panel",["exports"],function(e){function t(e){var t=Math.floor(e.$containerElement.height()/2) +e.$().css({display:"block",top:t+"px"}),e.$topPanelElement.css({height:t+"px"})}function n(e){var t=Math.floor(e.$containerElement.height()/2) +e.$().css({display:"none",height:t+"px"}),e.$topPanelElement.css({height:"100%"})}Object.defineProperty(e,"__esModule",{value:!0}),e.default=Ember.Component.extend({classNames:["bottom-panel"],didInsertElement:function(){var e=this +this._super.apply(this,arguments),this.$topPanelElement=Ember.$(this.get("topPanelElementId")),this.$containerElement=Ember.$(this.get("containerElementId")),Ember.run.next(this,function(){Ember.$(e.element).resizable({handles:"n",maxHeight:700,minHeight:200,resize:function(t,n){Ember.run.next(e,function(){e.$topPanelElement.css({height:e.$containerElement.height()-n.size.height})})}})})},visibilityObserver:Ember.observer("visible",function(){this.get("visible")?t(this):n(this)}),actions:{close:function(){this.set("visible",!1)}}})}),define("haskell-code-explorer/components/expression-info",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=Ember.Component.extend({})}),define("haskell-code-explorer/components/file-tree",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}) +var t=function e(t,o){return o.contents.map(function(o){var r={} +return r.text=o.name,r.data=o,o.path&&(r.id=o.path,r.a_attr={href:"/package/"+t+"/show/"+o.path}),"Dir"===o.tag?(r.children=e(t,o),r.state={opened:n(o)}):o.isHaskellModule?(r.icon="/assets/haskell.ico",r.isHaskellModule=!0):(r.icon="jstree-file",r.isHaskellModule=!1),r})},n=function e(t){return t.contents.some(function(t){return"File"===t.tag?t.isHaskellModule:e(t)})} +e.default=Ember.Component.extend({query:null,didInsertElement:function(){var e=this +this._super.apply(this,arguments) +var n=this.element.getElementsByClassName("file-tree")[0],o=Ember.$(n).jstree({core:{data:t(this.get("packageId"),this.get("directoryTree"))},plugins:["search"],search:{case_insensitive:!0,show_only_matches:!0,show_only_matches_children:!0}}) +o.on("select_node.jstree",function(t,n){var o=n.node.data +"Dir"!=o.tag&&e.sendAction("openFile",o.path)}) +var r=o.jstree(!0) +if(this.get("currentFile")){r.select_node(this.get("currentFile")) +var i=r.get_node(this.get("currentFile"),!0)[0] +i&&i.scrollIntoView()}this.jstree=r},currentFileObserver:Ember.observer("currentFile",function(){var e=this +Ember.run.next(function(){e.jstree.deselect_all(),e.jstree.select_node(e.get("currentFile"))})}),queryObserver:Ember.observer("query",function(){this.get("query")?this.jstree.search(this.get("query")):this.jstree.clear_search()}),actions:{hide:function(){this.get("hide")()}}})}),define("haskell-code-explorer/components/haskell-module",["exports","haskell-code-explorer/utils/go-to-definition","haskell-code-explorer/utils/line-selection"],function(e,t,n){function o(e,t){return e.line===t.line?e.column===t.column?0:e.column>t.column?1:-1:e.line>t.line?1:-1}function r(e,t,n){if(e[t.line]&&e[n.line]){if(t.line===n.line)return e[t.line].slice(t.column-1,n.column-1) +for(var o=e[t.line],r=[],i=t.line+1;i0){var r=null +o.forEach(function(o){var i=c(o,n.get("identifiers"),n.get("occurrences"),n.get("path"),n.get("colorTheme"),n.get("name")) +o.style.cssText=i,o.onmouseup=function(e){if(r&&clearTimeout(r),window.getSelection().isCollapsed){var i=n.get("identifiers")[o.dataset.identifier],l=n.get("occurrences")[o.dataset.occurrence],s=parseInt(o.parentNode.dataset.line) +"ModuleId"===l.sort.tag?(0,t.goToDefinition)(n.get("store"),l.sort.contents,e.which,s):l.isBinder||!i||1!==e.which&&2!==e.which||(0,t.goToDefinition)(n.get("store"),i.locationInfo,e.which,s)}},o.onmouseover=function(){l(e,o,!0),r&&clearTimeout(r),r=setTimeout(function(){Ember.run.next(n,function(){var e=n.get("identifiers")[o.dataset.identifier],t=n.get("occurrences")[o.dataset.occurrence] +console.log(t),console.log(e),n.set("selectedIdentifier",o),n.set("currentLineNumber",parseInt(o.parentNode.dataset.line)||1),n.set("identifierInfo",e),n.set("identifierOccurrence",t),n.set("hasSelectedExpression",!1),n.set("isHoveredOverIdentifier",!0)})},250)},o.onmouseout=function(){l(e,o,!1),r&&clearTimeout(r),r=setTimeout(function(){Ember.run.next(n,function(){n.set("isHoveredOverIdentifier",!1)})},250)}}),n.timer=r}}function u(e,t){return e===t||!!(16&e.compareDocumentPosition(t))}function p(e,t){var n=Array.prototype.slice.call(e.querySelectorAll("td.line-content")) +if(n.length>0){var i=[""] +n.forEach(function(e){i.push(e.textContent)}) +var l=["#text","SPAN","TD"],s=!1,a=!1,c=function(){Ember.run.next(function(){if(!s&&!a){a=!0,setTimeout(function(){a=!1},400),t.set("hasSelectedExpression",!1) +var n=window.getSelection() +if(n.anchorNode&&n.focusNode&&u(e,n.anchorNode)&&u(e,n.focusNode)&&-1!==l.indexOf(n.anchorNode.nodeName)&&-1!==l.indexOf(n.focusNode.nodeName)&&!n.isCollapsed){var c=document.createRange() +c.setStart(n.anchorNode,n.anchorOffset),c.setEnd(n.focusNode,n.focusOffset) +var d=c.collapsed,p=void 0,f=void 0,m=void 0,h=void 0 +d?(p=n.focusNode,f=n.focusOffset,m=n.anchorNode,h=n.anchorOffset):(p=n.anchorNode,f=n.anchorOffset,m=n.focusNode,h=n.focusOffset) +var b=void 0,g=void 0,v=void 0,x=void 0,y=void 0 +if("#text"===p.nodeName){var k=p.parentNode +if(g=parseInt(k.dataset.start)+f,b=parseInt(k.parentNode.dataset.line),f===p.textContent.length&&null===k.nextSibling){for(var E=p.parentNode.parentNode.parentNode,I=E.nextSibling;""===I.children[1].textContent;)I=I.nextSibling +y=I.children[1].children[0]}else y=0!==f&&k.nextSibling?k.nextSibling:k}else if("SPAN"===p.nodeName){g=1,b=parseInt(p.parentNode.dataset.line) +for(var P=p.parentNode.parentNode,_=P.nextSibling;""===_.children[1].textContent;)_=_.nextSibling +y=_.children[1].children[0]}else if("TD"===p.nodeName){if(f>0){var O=p.children[f-1] +g=parseInt(O.dataset.start)}else g=1 +b=parseInt(p.id.slice(2)),y=p.children[0]}if("#text"===m.nodeName)x=parseInt(m.parentNode.dataset.start)+h,v=parseInt(m.parentNode.parentNode.dataset.line) +else if("SPAN"===m.nodeName)x=1,v=parseInt(m.parentNode.dataset.line) +else if("TD"===m.nodeName){if(h>0){var w=m.children[h-1] +x=parseInt(w.dataset.start)}else x=1 +v=parseInt(m.id.slice(2))}var C=t.get("store").loadExpressions(t.get("packageId"),t.get("path"),b,g,v,x) +s=!0,C.then(function(e){Ember.run.next(function(){if(e&&e.length>0){e.sort(function(e,t){return o(e.srcSpan.start,t.srcSpan.start)<=0&&o(e.srcSpan.end,t.srcSpan.end)>=0?-1:1}) +var n=e.reduce(function(e,t){var n=Ember.copy(t),o=r(i,t.srcSpan.start,t.srcSpan.end) +return o?(n.sourceCode=o,e.concat(n)):e},[]) +n.length>0&&(t.set("selectedIdentifier",y),t.set("expressions",n),t.set("currentLineNumber",parseInt(y.parentNode.dataset.line)||1),t.set("hasSelectedExpression",!0))}s=!1})})}}})} +e.addEventListener("mouseup",c),t._onmouseup=c}}Object.defineProperty(e,"__esModule",{value:!0}),e.default=Ember.Component.extend({store:Ember.inject.service("store"),selectedIdentifier:null,isHoveredOverIdentifier:!1,hasSelectedExpression:!1,showDeclarations:!0,showDeclarationsLabel:Ember.computed("showDeclarations",function(){return this.get("showDeclarations")?"Hide":"Show"}),queryObserver:Ember.observer("query",function(){var e=this +Ember.run.debounce(this,function(){var t=new RegExp(e.get("query"),"i"),n=e.get("declarations").filter(function(e){return-1!=e.name.search(t)}) +Ember.run.next(function(){e.set("filteredDeclarations",n)})},300)}),identifierLocationInfo:Ember.computed("identifierInfo","identifierOccurrence",function(){var e=this.get("identifierOccurrence"),t=this.get("identifierInfo") +if(e)return"ModuleId"===e.sort.tag?e.sort.contents:t?t.locationInfo:null}),themeObserver:Ember.observer("colorTheme",function(){var e=this +Ember.run.next(this,function(){e.cleanup(),e.didInsertElement()})}),fileObserver:Ember.observer("path",function(){var e=this +Ember.run.next(this,function(){e.cleanup(),e.didInsertElement()})}),cleanup:function(){this.timer&&clearTimeout(this.timer),this._onhashchange&&window.removeEventListener("hashchange",this._onhashchange),this._onkeydown&&document.removeEventListener("keydown",this._onkeydown),this._onkeyup&&document.removeEventListener("keyup",this._onkeyup),this._onmouseup&&this.sourceCodeContainerElement.removeEventListener("mouseup",this._onmouseup),this.set("selectedIdentifier",null),this.set("isHoveredOverIdentifier",!1),this.set("hasSelectedExpression",!1),this.set("showDeclarations",!0)},didReceiveAttrs:function(){this.set("filteredDeclarations",this.get("declarations"))},didInsertElement:function(){var e=this +this._super.apply(this,arguments) +var t=this.element.querySelector(".source-code-container") +t.innerHTML=this.get("html"),this.sourceCodeContainerElement=t,this.element.parentNode.scrollTop=0 +var o=this.element.querySelector(".declarations-content") +this.set("query",""),o&&(o.scrollTop=0),Ember.run.next(this,function(){d(t,e),(0,n.initializeLineSelection)(t,e),p(t,e)})},willDestroyElement:function(){this.cleanup()},actions:{goToLine:function(e){window.location.hash="L"+e},toggleShowDeclarations:function(){this.toggleProperty("showDeclarations")}}})}),define("haskell-code-explorer/components/identifier-info",["exports","haskell-code-explorer/utils/go-to-definition"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=Ember.Component.extend({store:Ember.inject.service("store"),downloadedDocumentation:null,didInsertElement:function(){var e=this,n=function(n){if(n.target.dataset.location){var o=void 0 +try{o=JSON.parse(n.target.dataset.location)}catch(e){console.log(e)}o&&(0,t.goToDefinition)(e.get("store"),o,n.which,e.get("currentLineNumber"))}} +this.element.addEventListener("mouseup",n),this._onmouseup=n},willDestroyElement:function(){this._onmouseup&&this.element.removeEventListener("mouseup",this._onmouseup)},isNaughtyRecSel:Ember.computed("identifierInfo",function(){var e=this.get("identifierInfo") +return!!e&&"RecSelIdNaughty"===e.details}),isExternalIdentifier:Ember.computed("identifierInfo",function(){var e=this.get("identifierInfo") +return!!e&&"External"===e.sort}),identifierObserver:Ember.observer("identifierInfo",function(){var e=this +this.set("downloadedDocumentation","") +var t=this.get("identifierInfo") +if(t){var n=t.locationInfo +if("ApproximateLocation"===n.tag){var o=n.packageId.name+"-"+n.packageId.version,r=t +this.get("store").loadDefinitionSite(o,n.moduleName,n.componentId,n.entity,n.name).then(function(t){Ember.run.next(e,function(){r===e.get("identifierInfo")&&e.set("downloadedDocumentation",t.documentation)})})}}})})}),define("haskell-code-explorer/components/identifier-name",["exports","haskell-code-explorer/utils/go-to-definition"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=Ember.Component.extend({store:Ember.inject.service("store"),name:Ember.computed("identifierElement",function(){var e=this.get("identifierElement") +if(e)return e.innerText}),style:Ember.computed("identifierElement",function(){var e=this.get("identifierElement") +if(e)return new Ember.String.htmlSafe("color:"+e.style.color)}),locationInfo:Ember.computed("identifierInfo","identifierOccurrence",function(){return"ModuleId"===this.get("identifierOccurrence.sort.tag")?this.get("identifierOccurrence.sort.contents"):this.get("identifierInfo.locationInfo")}),location:Ember.computed("locationInfo",function(){var e=this.get("locationInfo") +return e?"ExactLocation"===e.tag?e.modulePath:"ApproximateLocation"===e.tag?"Mod"===e.entity?e.packageId.name+"-"+e.packageId.version:e.packageId.name+"-"+e.packageId.version+" "+e.moduleName:e.contents:""}),isExternalIdentifier:Ember.computed("identifierInfo",function(){return"External"===this.get("identifierInfo.sort")}),actions:{goToDefinition:function(e){return(0,t.goToDefinition)(this.get("store"),this.get("locationInfo"),e.which,this.get("currentLineNumber")),!1},findReferences:function(e,t){this.get("findReferences")(t,e.externalId,e.demangledOccName)}}})}),define("haskell-code-explorer/components/infinite-list",["exports"],function(e){function t(e){e.set("renderedElements",e.get("elements").slice(0,e.get("perPage"))),n=1}Object.defineProperty(e,"__esModule",{value:!0}) +var n=void 0,o=!1 +e.default=Ember.Component.extend({renderedElements:[],init:function(){this._super.apply(this,arguments),t(this)},elementsObserver:Ember.observer("elements",function(){t(this) +var e=document.getElementById(this.get("containerElementId")) +e&&(e.scrollTop=0)}),didInsertElement:function(){var e=document.getElementById(this.get("containerElementId")) +if(e){var t=this +e.onscroll=function(){var r=t.get("perPage"),i=t.get("elements") +!o&&n*rt.element.offsetHeight-100&&(o=!0,Ember.run.next(t,function(){var e=i.slice(n*r,(n+1)*r) +t.get("renderedElements").pushObjects(e),n++,o=!1}))}}}})}),define("haskell-code-explorer/components/info-window",["exports"],function(e){function t(e){var t=e.get("targetElement") +if(t){var n=e.element.offsetHeight,o=t.offsetHeight,r=t.parentNode,i=document.querySelector("#"+e.get("containerElementId")),l=t.getBoundingClientRect().top,s=void 0 +s=i?i.getBoundingClientRect().top:0 +var a=void 0 +a=l0&&(-1!==e?e===n-1?this.set("highlightedItemIndex",0):this.set("highlightedItemIndex",e+1):this.set("highlightedItemIndex",0))},onUp:function(){this.showAutocompleteList() +var e=this.get("highlightedItemIndex"),t=this.get("items"),n=t.length +n>0&&(-1!==e?0===e?this.set("highlightedItemIndex",n-1):this.set("highlightedItemIndex",e-1):this.set("highlightedItemIndex",n-1))},hideAutocompleteList:function(){this.set("highlightedItemIndex",-1),this.$autocompleteContainer.css({display:"none"})},showAutocompleteList:function(){this.$autocompleteContainer.css({display:"block"})},queryObserver:Ember.observer("query",function(){var e=this +if(this.get("query")){var t=this.get("maxItems")?this.get("maxItems"):10,n=this.get("createSearchUrlFunction")(this.get("query"))+"?per_page="+t +Ember.run.debounce(this,function(){e.get("store").loadFromUrlPaginated(n).then(function(t){Ember.run.next(function(){e.set("items",t.items)})})},400),this.showAutocompleteList()}else this.hideAutocompleteList(),this.set("items",[])}),actions:{onSubmit:function(){this.hideAutocompleteList(),this.get("onSubmit")(this.get("query"))},goToDefinition:function(e){this.hideAutocompleteList(),this.get("selectItem")(e)}}})}),define("haskell-code-explorer/components/instance-info",["exports","haskell-code-explorer/utils/go-to-definition"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=Ember.Component.extend({store:Ember.inject.service("store"),style:Ember.computed("nestedLevel",function(){return new Ember.String.htmlSafe("margin-left :"+10*this.get("nestedLevel")+"px")}),nextNestedLevel:Ember.computed("nestedLevel",function(){return this.get("nestedLevel")+1}),actions:{goToDefinition:function(e){return(0,t.goToDefinition)(this.get("store"),this.get("instance.location"),e.which,this.get("currentLineNumber")),!1}}})}),define("haskell-code-explorer/components/labeled-radio-button",["exports","ember-radio-button/components/labeled-radio-button"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("haskell-code-explorer/components/paginated-list",["exports"],function(e){function t(e,t,n){e.loadFromUrlPaginated(n).then(function(e){Ember.run.next(function(){t.set("total",e.total),t.set("items",e.items),t.set("first",e.linkHeader.first),t.set("next",e.linkHeader.next),t.set("prev",e.linkHeader.prev),t.set("last",e.linkHeader.last) +var o=n.match(/(&|\?)page=(\d+)/),r=n.match(/(&|\?)per_page=(\d+)/),i=o?o[2]:1,l=r?r[2]:20;(e.linkHeader.next||e.linkHeader.prev)&&(t.set("firstItemOnPage",(i-1)*l+1),e.linkHeader.last?t.set("lastItemOnPage",i*l):t.set("lastItemOnPage",e.total))})})}Object.defineProperty(e,"__esModule",{value:!0}),e.default=Ember.Component.extend({store:Ember.inject.service("store"),init:function(){this._super.apply(this,arguments),this.get("url")&&t(this.get("store"),this,this.get("url"))},urlObserver:Ember.observer("url",function(){t(this.get("store"),this,this.get("url")),this.element.querySelector(".paginated-list-content").scrollTop=0}),actions:{update:function(e){this.element.querySelector(".paginated-list-content").scrollTop=0,t(this.get("store"),this,e)}}})}),define("haskell-code-explorer/components/radio-button-input",["exports","ember-radio-button/components/radio-button-input"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("haskell-code-explorer/components/radio-button",["exports","ember-radio-button/components/radio-button"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("haskell-code-explorer/components/resizable-panel",["exports"],function(e){function t(e,t){e.$alsoResizeElement.css({left:0}),e.$().css({width:0}),e.set("hidden",!0),e.$(".show-left-panel-button").show(),t&&e.set("hiddenByUser",!0)}function n(e,t){e.$alsoResizeElement.css({left:300}),e.$().css({width:300}),e.set("hidden",!1),e.$(".show-left-panel-button").hide(),t&&e.set("hiddenByUser",!1)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=Ember.Component.extend({hidden:!1,hiddenByUser:!1,didInsertElement:function(){var e=this +this._super.apply(this,arguments),Ember.run.next(this,function(){var o=function(){if(!e.get("hiddenByUser")){var o=window.innerWidth +!e.get("hidden")&&o<700?t(e,!1):e.get("hidden")&&o>700&&n(e,!1)}} +e._onresize=o,window.addEventListener("resize",o) +var r=Ember.$(e.get("alsoResizeElementId")) +Ember.$(e.element).resizable({maxWidth:800,minWidth:200,handles:"e",resize:function(t,n){Ember.run.next(e,function(){r.css({left:n.size.width})})}}),e.$alsoResizeElement=r})},hideButtonLabel:Ember.computed("hidden",function(){return this.get("hidden")?">":"<"}),willDestroyElement:function(){this._onresize&&window.removeEventListener("resize",this._onresize)},actions:{hide:function(){this.get("hidden")?n(this,!0):t(this,!0)}}})}),define("haskell-code-explorer/components/text-file",["exports","haskell-code-explorer/utils/line-selection"],function(e,t){function n(e){return e.replace(/[\"&<>]/g,function(e){return{'"':""","&":"&","<":"<",">":">"}[e]})}function o(e){var t=0 +return""+e.split("\n").map(function(e){return""}).join("")+"
"+t+""+n(e)+"
"}Object.defineProperty(e,"__esModule",{value:!0}) +var r=["markdown","mdown","mkdn","mkd","md"] +e.default=Ember.Component.extend({isMarkdown:Ember.computed("path",function(){var e=this.get("path").split(".").pop() +return r.any(function(t){return e===t})}),html:Ember.computed("path","isMarkdown",function(){return this.get("isMarkdown")?this.markdownConverter.makeHtml(this.get("text")):o(this.get("text"))}),init:function(){this._super.apply(this,arguments),this.markdownConverter=new showdown.Converter},didInsertElement:function(){var e=this.element.querySelector(".source-code-container");(0,t.initializeLineSelection)(e,this),this.element.parentNode.scrollTop=0},willDestroyElement:function(){this.cleanup()},cleanup:function(){this._onhashchange&&window.removeEventListener("hashchange",this._onhashchange),this._onkeydown&&document.removeEventListener("keydown",this._onkeydown),this._onkeyup&&document.removeEventListener("keyup",this._onkeyup)},pathObserver:Ember.observer("path",function(){var e=this +Ember.run.next(this,function(){e.cleanup(),e.didInsertElement()})})})}),define("haskell-code-explorer/components/type-component",["exports","haskell-code-explorer/utils/go-to-definition"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=Ember.Component.extend({store:Ember.inject.service("store"),tagName:"span",classNames:["type-component"],contextMenu:function(){return this.get("identifiers")&&this.get("internalId")&&this.set("expanded",!0),!1},linkClass:Ember.computed("identifierInfo",function(){return this.get("identifierInfo")?"link":""}),identifierInfo:Ember.computed("internalId",function(){return this.get("internalId")?this.get("identifiers")[this.get("internalId")]:null}),actions:{onmouseup:function(e){if(this.get("identifierInfo")&&3!==e.which){var n=this.get("identifierInfo").locationInfo +return(0,t.goToDefinition)(this.get("store"),n,e.which,this.get("currentLineNumber")),!1}}}})}),define("haskell-code-explorer/components/type-signature-text",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=Ember.Component.extend({tagName:"span"})}),define("haskell-code-explorer/components/type-signature",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=Ember.Component.extend({tagName:"span",expandTypeSynonyms:!1,expandTypeSynonymsLabel:Ember.computed("expandTypeSynonyms",function(){return this.get("expandTypeSynonyms")?"Show type synonyms":"Expand type synonyms"}),components:Ember.computed("type","expandTypeSynonyms",function(){return this.get("expandTypeSynonyms")&&this.get("type.componentsExpanded")?this.get("type.componentsExpanded"):this.get("type.components")}),typeObserver:Ember.observer("type",function(){this.set("expandTypeSynonyms",!1)}),actions:{toggleExpandTypeSynonyms:function(){this.toggleProperty("expandTypeSynonyms")}}})}),define("haskell-code-explorer/controllers/application",["exports","haskell-code-explorer/utils/color-themes"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=Ember.Controller.extend({settings:Ember.inject.service("settings"),themes:Object.values(t.themes),init:function(){this._super.apply(this,arguments),(0,t.updateColorThemeCss)(this.get("settings").get("colorTheme"))},currentTheme:Ember.computed("settings",function(){return this.get("settings.colorTheme.id")}),actions:{themeChanged:function(e){var n=t.themes[e] +this.get("settings").set("colorTheme",n),(0,t.updateColorThemeCss)(n)}}})}),define("haskell-code-explorer/controllers/package",["exports","haskell-code-explorer/utils/go-to-definition"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=Ember.Controller.extend({store:Ember.inject.service("store"),currentFile:null,loadItemsFunction:null,query:null,actions:{searchIdentifier:function(e){e&&(this.set("currentFile",null),document.title=this.get("model.id"),this.transitionToRoute("package.search",e))},showIdentifier:function(e){return(0,t.goToDefinition)(this.get("store"),e.locationInfo,1,null),!1}}})}),define("haskell-code-explorer/controllers/package/index",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=Ember.Controller.extend({modulesFiltered:Ember.computed("model","query",function(){var e=this.get("query"),t=Object.keys(this.get("model.modules")).sort() +if(e){var n=new RegExp(e,"i") +return t.filter(function(e){return-1!=e.search(n)})}return t})})}),define("haskell-code-explorer/controllers/package/search",["exports","haskell-code-explorer/utils/go-to-definition"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=Ember.Controller.extend({store:Ember.inject.service("store"),actions:{goToDefinition:function(e,n){return(0,t.goToDefinition)(this.get("store"),e,n.which,null),!1}}})}),define("haskell-code-explorer/controllers/package/show/file",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=Ember.Controller.extend({settings:Ember.inject.service("settings"),actions:{findReferences:function(e,t,n){this.send("updateReferences",e,t,n)}}})}),define("haskell-code-explorer/controllers/packages",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=Ember.Controller.extend({queryObserver:Ember.observer("query",function(){var e=this +Ember.run.debounce(this,function(){var t=new RegExp(e.get("query"),"i"),n=e.get("model").filter(function(e){return-1!=e.name.search(t)}) +Ember.run.next(function(){e.set("packages",n)})},300)})})}),define("haskell-code-explorer/helpers/and",["exports","ember-truth-helpers/helpers/and"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"and",{enumerable:!0,get:function(){return t.and}})}),define("haskell-code-explorer/helpers/app-version",["exports","haskell-code-explorer/config/environment","ember-cli-app-version/utils/regexp"],function(e,t,n){function o(e){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.default.APP.version,i=o.versionOnly||o.hideSha,l=o.shaOnly||o.hideVersion,s=null +return i&&(o.showExtended&&(s=r.match(n.versionExtendedRegExp)),s||(s=r.match(n.versionRegExp))),l&&(s=r.match(n.shaRegExp)),s?s[0]:r}Object.defineProperty(e,"__esModule",{value:!0}),e.appVersion=o,e.default=Ember.Helper.helper(o)}),define("haskell-code-explorer/helpers/eq",["exports","ember-truth-helpers/helpers/equal"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"equal",{enumerable:!0,get:function(){return t.equal}})}),define("haskell-code-explorer/helpers/gt",["exports","ember-truth-helpers/helpers/gt"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"gt",{enumerable:!0,get:function(){return t.gt}})}) +define("haskell-code-explorer/helpers/gte",["exports","ember-truth-helpers/helpers/gte"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"gte",{enumerable:!0,get:function(){return t.gte}})}),define("haskell-code-explorer/helpers/is-array",["exports","ember-truth-helpers/helpers/is-array"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"isArray",{enumerable:!0,get:function(){return t.isArray}})}),define("haskell-code-explorer/helpers/is-equal",["exports","ember-truth-helpers/helpers/is-equal"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"isEqual",{enumerable:!0,get:function(){return t.isEqual}})}),define("haskell-code-explorer/helpers/lt",["exports","ember-truth-helpers/helpers/lt"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"lt",{enumerable:!0,get:function(){return t.lt}})}),define("haskell-code-explorer/helpers/lte",["exports","ember-truth-helpers/helpers/lte"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"lte",{enumerable:!0,get:function(){return t.lte}})}),define("haskell-code-explorer/helpers/not-eq",["exports","ember-truth-helpers/helpers/not-equal"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"notEq",{enumerable:!0,get:function(){return t.notEq}})}),define("haskell-code-explorer/helpers/not",["exports","ember-truth-helpers/helpers/not"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"not",{enumerable:!0,get:function(){return t.not}})}),define("haskell-code-explorer/helpers/or",["exports","ember-truth-helpers/helpers/or"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"or",{enumerable:!0,get:function(){return t.or}})}),define("haskell-code-explorer/helpers/xor",["exports","ember-truth-helpers/helpers/xor"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"xor",{enumerable:!0,get:function(){return t.xor}})}),define("haskell-code-explorer/initializers/app-version",["exports","ember-cli-app-version/initializer-factory","haskell-code-explorer/config/environment"],function(e,t,n){Object.defineProperty(e,"__esModule",{value:!0}) +var o=void 0,r=void 0 +n.default.APP&&(o=n.default.APP.name,r=n.default.APP.version),e.default={name:"App Version",initialize:(0,t.default)(o,r)}}),define("haskell-code-explorer/initializers/container-debug-adapter",["exports","ember-resolver/resolvers/classic/container-debug-adapter"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default={name:"container-debug-adapter",initialize:function(){var e=arguments[1]||arguments[0] +e.register("container-debug-adapter:main",t.default),e.inject("container-debug-adapter:main","namespace","application:main")}}}),define("haskell-code-explorer/initializers/export-application-global",["exports","haskell-code-explorer/config/environment"],function(e,t){function n(){var e=arguments[1]||arguments[0] +if(!1!==t.default.exportApplicationGlobal){var n +if("undefined"!=typeof window)n=window +else if("undefined"!=typeof global)n=global +else{if("undefined"==typeof self)return +n=self}var o,r=t.default.exportApplicationGlobal +o="string"==typeof r?r:Ember.String.classify(t.default.modulePrefix),n[o]||(n[o]=e,e.reopen({willDestroy:function(){this._super.apply(this,arguments),delete n[o]}}))}}Object.defineProperty(e,"__esModule",{value:!0}),e.initialize=n,e.default={name:"export-application-global",initialize:n}}),define("haskell-code-explorer/router",["exports","haskell-code-explorer/config/environment"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}) +var n=Ember.Router.extend({location:t.default.locationType}) +n.map(function(){this.route("packages",{path:""}),this.route("package",{path:"/package/:packageId"},function(){this.route("show",function(){this.route("file",{path:"*filePath"},function(){})}),this.route("search",{path:"/search/:query"})}),this.route("bad-url",{path:"/*badurl"})}),e.default=n}),define("haskell-code-explorer/routes/application",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=Ember.Route.extend({})}),define("haskell-code-explorer/routes/package",["exports","haskell-code-explorer/utils/api-urls"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=Ember.Route.extend({store:Ember.inject.service("store"),model:function(e){var t=this +return this.get("store").loadPackage(e.packageId).catch(function(e){console.log(e),t.transitionTo("/package-not-found")})},afterModel:function(e){document.title=e.id},setupController:function(e,n){this._super(e,n) +var o=this.modelFor("package").id +e.set("bottomPanelVisible",!1),e.set("createSearchUrlFunction",function(e){return t.urls.identifierSearchUrl(o,e)})},actions:{openFile:function(e){this.transitionTo("package.show.file",e)},fileOpened:function(e){this.get("controller")&&this.set("controller.currentFile",e)},updateReferences:function(e,n,o){this.set("controller.packageId",e),this.set("controller.externalId",n),this.set("controller.occName",o),this.set("controller.bottomPanelVisible",!0),this.set("controller.referencesUrl",t.urls.referencesUrl(e,n)+"?per_page=50")}}})}),define("haskell-code-explorer/routes/package/index",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=Ember.Route.extend({afterModel:function(e,t){t.send("fileOpened",null)}})}),define("haskell-code-explorer/routes/package/search",["exports","haskell-code-explorer/utils/api-urls","haskell-code-explorer/utils/go-to-definition"],function(e,t,n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=Ember.Route.extend({store:Ember.inject.service("store"),model:function(e){return{query:e.query,url:t.urls.identifierSearchUrl(this.modelFor("package").id,e.query)+"?per_page=20"}},afterModel:function(){var e=this,t=function(t){if(t.target.dataset.location){var o=void 0 +try{o=JSON.parse(t.target.dataset.location)}catch(e){console.log(e)}o&&(0,n.goToDefinition)(e.get("store"),o,t.which)}} +this._onmouseup=t,document.addEventListener("mouseup",t)},deactivate:function(){this._onmouseup&&document.removeEventListener("mouseup",this._onmouseup)}})}),define("haskell-code-explorer/routes/package/show/file",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=Ember.Route.extend({store:Ember.inject.service(),model:function(e){var t=this,n=this.modelFor("package") +return n.modules[e.filePath]?this.get("store").loadHaskellModule(n.id,e.filePath).catch(function(e){console.log(e),t.transitionTo("/not-found")}):this.get("store").loadFile(n.id,e.filePath).then(function(e){return document.title=n.id,e}).catch(function(e){console.log(e),t.transitionTo("/not-found")})},afterModel:function(e){document.title=e.id+" - "+this.modelFor("package").id},actions:{didTransition:function(){this.send("fileOpened",this.currentModel.id)}}})}),define("haskell-code-explorer/routes/package/show/index",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=Ember.Route.extend({afterModel:function(e,t){t.send("fileOpened",null)}})}),define("haskell-code-explorer/routes/packages",["exports","haskell-code-explorer/utils/api-urls","haskell-code-explorer/config/environment"],function(e,t,n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=Ember.Route.extend({model:function(){return Ember.$.getJSON(t.urls.packagesUrl)},setupController:function(e,t){this._super(e,t),e.set("packages",t)},afterModel:function(){document.title=n.default.APP.title}})}),define("haskell-code-explorer/services/settings",["exports","haskell-code-explorer/utils/color-themes"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=Ember.Service.extend({init:function(){if(this._super.apply(this,arguments),localStorage){var e=localStorage.getItem("colorThemeId"),n=t.themes[e] +e&&this.set("colorTheme",n)}},colorTheme:t.themes.darkTheme,settingsObserver:Ember.observer("colorTheme",function(){localStorage&&localStorage.setItem("colorThemeId",this.get("colorTheme").id)})})}),define("haskell-code-explorer/services/store",["exports","haskell-code-explorer/utils/api-urls"],function(e,t){function n(e){return'"'==e.charAt(0)&&'"'==e.charAt(e.length-1)?e.substring(1,e.length-1):e}function o(e){if(!e)return{} +for(var t=/<[^>]*>\s*(\s*;\s*[^\(\)<>@,;:"\/\[\]\?={} \t]+=(([^\(\)<>@,;:"\/\[\]\?={} \t]+)|("[^"]*")))*(,|$)/g,o=/[^\(\)<>@,;:"\/\[\]\?={} \t]+=(([^\(\)<>@,;:"\/\[\]\?={} \t]+)|("[^"]*"))/g,r=e.match(t),i=new Object,l=0;l"),a=s[0].substring(1),c=s[1],d=new Object +d.href=a +for(var u=c.match(o),p=0;p"],[9]],"parameters":[]},null],[0,"\\n "],[4,"if",[[22,["last"]]],null,{"statements":[[6,"button"],[10,"button",""],[10,"class","btn btn-outline-secondary btn-sm"],[3,"action",[[21,0,[]],"update",[22,["last","href"]]]],[8],[0,">>"],[9]],"parameters":[]},null],[0,"\\n "],[9],[0,"\\n"]],"parameters":[]},null],[9],[0,"\\n"],[6,"div"],[10,"class","paginated-list-content"],[8],[0,"\\n "],[13,1,[[22,["items"]]]],[0," \\n"],[9],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"haskell-code-explorer/templates/components/paginated-list.hbs"}})}),define("haskell-code-explorer/templates/components/resizable-panel",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=Ember.HTMLBars.template({id:"tpKUpnLR",block:'{"symbols":["&default"],"statements":[[6,"div"],[10,"class","absolute-container"],[8],[13,1,[[26,"action",[[21,0,[]],"hide"],null]]],[0,"\\n "],[6,"div"],[11,"onclick",[26,"action",[[21,0,[]],"hide"],null]],[10,"class","show-left-panel-button"],[8],[0,"\\n "],[1,[20,"hideButtonLabel"],true],[0,"\\n "],[9],[0,"\\n"],[9],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"haskell-code-explorer/templates/components/resizable-panel.hbs"}})}),define("haskell-code-explorer/templates/components/text-file",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=Ember.HTMLBars.template({id:"yYFMOyZb",block:'{"symbols":[],"statements":[[6,"div"],[10,"class","source-code-container"],[8],[0,"\\n"],[1,[20,"html"],true],[0,"\\n"],[9],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"haskell-code-explorer/templates/components/text-file.hbs"}})}),define("haskell-code-explorer/templates/components/type-component",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=Ember.HTMLBars.template({id:"nSuhY152",block:'{"symbols":[],"statements":[[4,"if",[[26,"and",[[22,["expanded"]],[22,["identifierInfo"]]],null]],null,{"statements":[[0,"("]],"parameters":[]},null],[0,"\\n"],[6,"span"],[11,"class",[27,["source-code ",[20,"linkClass"]]]],[11,"onmouseup",[26,"action",[[21,0,[]],"onmouseup"],null]],[8],[1,[20,"occName"],false],[9],[0,"\\n"],[4,"if",[[26,"and",[[22,["expanded"]],[22,["identifierInfo"]]],null]],null,{"statements":[[0," :: "],[1,[26,"type-signature",null,[["type","identifiers","noExpand"],[[22,["identifierInfo","idType"]],[22,["identifiers"]],true]]],false],[0,")"]],"parameters":[]},null],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"haskell-code-explorer/templates/components/type-component.hbs"}})}),define("haskell-code-explorer/templates/components/type-signature-text",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=Ember.HTMLBars.template({id:"+rUvtMa3",block:'{"symbols":["typeComponent"],"statements":[[4,"each",[[22,["components"]]],null,{"statements":[[4,"if",[[26,"eq",[[21,1,["tag"]],"Text"],null]],null,{"statements":[[1,[21,1,["contents"]],false]],"parameters":[]},{"statements":[[1,[21,1,["name"]],false]],"parameters":[]}]],"parameters":[1]},null],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"haskell-code-explorer/templates/components/type-signature-text.hbs"}})}),define("haskell-code-explorer/templates/components/type-signature",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=Ember.HTMLBars.template({id:"SdJzinj9",block:'{"symbols":["typeComponent"],"statements":[[4,"each",[[22,["components"]]],null,{"statements":[[4,"if",[[26,"eq",[[21,1,["tag"]],"Text"],null]],null,{"statements":[[6,"span"],[10,"class","source-code"],[8],[1,[21,1,["contents"]],false],[9]],"parameters":[]},{"statements":[[1,[26,"type-component",null,[["occName","internalId","identifiers","currentLineNumber"],[[21,1,["name"]],[21,1,["internalId"]],[22,["identifiers"]],[22,["currentLineNumber"]]]]],false]],"parameters":[]}]],"parameters":[1]},null],[0,"\\n"],[4,"unless",[[22,["noExpand"]]],null,{"statements":[[4,"if",[[22,["type","componentsExpanded"]]],null,{"statements":[[0," "],[6,"div"],[10,"style","margin-top:5px"],[8],[0,"\\n "],[6,"button"],[10,"class","btn btn-outline-secondary btn-sm"],[3,"action",[[21,0,[]],"toggleExpandTypeSynonyms"]],[8],[1,[20,"expandTypeSynonymsLabel"],false],[0,"\\n "],[9],[0,"\\n "],[9],[0,"\\n"]],"parameters":[]},null]],"parameters":[]},null]],"hasEval":false}',meta:{moduleName:"haskell-code-explorer/templates/components/type-signature.hbs"}})}),define("haskell-code-explorer/templates/package",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=Ember.HTMLBars.template({id:"wmOuG9eh",block:'{"symbols":["section","files","file","reference","hide","identifier"],"statements":[[6,"div"],[10,"class","flex-container"],[8],[0,"\\n "],[6,"div"],[10,"class","package-header"],[8],[0,"\\n "],[6,"span"],[10,"class","package-header-package-name"],[8],[4,"link-to",["package",[22,["model"]]],null,{"statements":[[1,[22,["model","id"]],false]],"parameters":[]},null],[9],[0," \\n "],[6,"span"],[10,"class","package-header-input"],[8],[0,"\\n"],[4,"input-with-autocomplete",null,[["onSubmit","createSearchUrlFunction","maxItems","selectItem","placeholder"],[[26,"action",[[21,0,[]],"searchIdentifier"],null],[22,["createSearchUrlFunction"]],10,[26,"action",[[21,0,[]],"showIdentifier"],null],"Identifier"]],{"statements":[[0," "],[6,"span"],[10,"class","source-code-font"],[8],[1,[21,6,["demangledOccName"]],false],[0," :: "],[1,[26,"type-signature-text",null,[["components"],[[21,6,["idType","components"]]]]],false],[9],[0,"\\n "],[6,"div"],[10,"class","module-name"],[8],[0,"\\n"],[4,"if",[[21,6,["locationInfo","modulePath"]]],null,{"statements":[[0," "],[1,[21,6,["locationInfo","modulePath"]],false],[0,"\\n"]],"parameters":[]},{"statements":[[0," "],[1,[21,6,["locationInfo","moduleName"]],false],[0,"\\n"]],"parameters":[]}],[0," "],[9],[0,"\\n"]],"parameters":[6]},null],[0," "],[9],[0,"\\n"],[4,"if",[[22,["currentFile"]]],null,{"statements":[[0," "],[6,"span"],[10,"class","package-header-filename"],[8],[0,"\\n "],[1,[20,"currentFile"],false],[0,"\\n "],[9],[0,"\\n"]],"parameters":[]},null],[0," "],[9],[0,"\\n "],[6,"div"],[10,"class","package-content"],[8],[0,"\\n"],[4,"resizable-panel",null,[["class","alsoResizeElementId"],["left-panel","#right-panel"]],{"statements":[[0," "],[6,"div"],[10,"class","file-tree-container"],[8],[0,"\\n "],[1,[26,"file-tree",null,[["directoryTree","openFile","currentFile","packageId","hide"],[[22,["model","directoryTree"]],"openFile",[22,["currentFile"]],[22,["model","id"]],[21,5,[]]]]],false],[0,"\\n "],[9],[0,"\\n"]],"parameters":[5]},null],[0," "],[6,"div"],[10,"id","right-panel"],[10,"class","right-panel"],[8],[0,"\\n "],[6,"div"],[10,"id","file-container"],[10,"class","file-container"],[8],[0," \\n "],[1,[20,"outlet"],false],[0," \\n "],[9],[0,"\\n"],[4,"bottom-panel",null,[["visible","topPanelElementId","containerElementId"],[[22,["bottomPanelVisible"]],"#file-container","#right-panel"]],{"statements":[[4,"if",[[26,"eq",[[21,1,[]],"header"],null]],null,{"statements":[[0," References to "],[6,"b"],[8],[6,"span"],[10,"class","source-code"],[8],[1,[20,"occName"],false],[9],[9],[0," in "],[6,"span"],[10,"class","source-code"],[8],[1,[20,"packageId"],false],[9],[0,"\\n"]],"parameters":[]},{"statements":[[4,"paginated-list",null,[["url"],[[22,["referencesUrl"]]]],{"statements":[[0," "],[6,"ul"],[8],[0,"\\n"],[4,"each",[[21,2,[]]],null,{"statements":[[0," "],[6,"li"],[8],[0,"\\n "],[6,"div"],[10,"class","file-name"],[8],[6,"a"],[11,"href",[27,["/package/",[20,"packageId"],"/show/",[21,3,["name"]]]]],[8],[1,[21,3,["name"]],false],[9],[9],[0,"\\n"],[4,"each",[[21,3,["references"]]],null,{"statements":[[0," "],[6,"a"],[10,"class","source-code source-code-snippet"],[11,"href",[27,["/package/",[20,"packageId"],"/show/",[21,3,["name"]],"#L",[21,4,["idSrcSpan","line"]]]]],[8],[1,[21,4,["sourceCodeHtml"]],true],[9],[0,"\\n"]],"parameters":[4]},null],[0," "],[9],[0,"\\n"]],"parameters":[3]},null],[0," "],[9],[0,"\\n"]],"parameters":[2]},null]],"parameters":[]}]],"parameters":[1]},null],[0," "],[9],[0,"\\n "],[9],[0,"\\n"],[9],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"haskell-code-explorer/templates/package.hbs"}})}),define("haskell-code-explorer/templates/package/index",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=Ember.HTMLBars.template({id:"NL2mPZNK",block:'{"symbols":["module"],"statements":[[6,"div"],[10,"class","package-modules"],[8],[0,"\\n "],[6,"div"],[10,"class","module-search-input"],[8],[0,"\\n "],[1,[26,"input",null,[["class","type","value","placeholder"],["form-control","text",[22,["query"]],"Module name"]]],false],[0," \\n "],[9],[0," \\n "],[6,"ul"],[10,"class","modules"],[8],[0,"\\n"],[4,"each",[[22,["modulesFiltered"]]],null,{"statements":[[0," "],[6,"li"],[8],[0,"\\n "],[6,"a"],[11,"href",[27,["/package/",[22,["model","id"]],"/show/",[21,1,[]]]]],[8],[1,[21,1,[]],false],[9],[0,"\\n "],[9],[0,"\\n"]],"parameters":[1]},null],[0," "],[9],[0," \\n"],[9],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"haskell-code-explorer/templates/package/index.hbs"}})}),define("haskell-code-explorer/templates/package/search",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=Ember.HTMLBars.template({id:"tnwltDLx",block:'{"symbols":["identifiers","identifier"],"statements":[[6,"div"],[10,"class","search-results-header"],[8],[0,"\\n Query : "],[1,[22,["model","query"]],false],[0,"\\n"],[9],[0,"\\n"],[6,"div"],[10,"class","search-results-content"],[8],[0,"\\n"],[4,"paginated-list",null,[["url"],[[22,["model","url"]]]],{"statements":[[0," "],[6,"ul"],[8],[0,"\\n"],[4,"each",[[21,1,[]]],null,{"statements":[[0," "],[6,"li"],[10,"class","search-result"],[8],[0," \\n "],[6,"span"],[10,"class","source-code"],[8],[1,[21,2,["demangledOccName"]],false],[0," :: "],[1,[26,"type-signature-text",null,[["components"],[[21,2,["idType","components"]]]]],false],[9],[0,"\\n "],[6,"div"],[8],[6,"a"],[10,"href","#"],[11,"onmouseup",[26,"action",[[21,0,[]],"goToDefinition",[21,2,["locationInfo"]]],null]],[8],[0,"Go to definition"],[9],[9],[0,"\\n "],[6,"div"],[10,"class","identifier-module"],[8],[0,"\\n"],[4,"if",[[21,2,["locationInfo","modulePath"]]],null,{"statements":[[0," Defined in "],[6,"a"],[11,"href",[27,["/package/",[21,2,["locationInfo","packageId","name"]],"-",[21,2,["locationInfo","packageId","version"]],"/show/",[21,2,["locationInfo","modulePath"]]]]],[8],[1,[21,2,["locationInfo","modulePath"]],false],[9],[0,"\\n"]],"parameters":[]},null],[0," "],[9],[0,"\\n "],[6,"div"],[8],[1,[21,2,["doc"]],true],[9],[0,"\\n "],[9],[0,"\\n"]],"parameters":[2]},null],[0," "],[9],[0,"\\n"]],"parameters":[1]},null],[9],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"haskell-code-explorer/templates/package/search.hbs"}})}),define("haskell-code-explorer/templates/package/show",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=Ember.HTMLBars.template({id:"aR1d98il",block:'{"symbols":[],"statements":[[1,[20,"outlet"],false],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"haskell-code-explorer/templates/package/show.hbs"}})}),define("haskell-code-explorer/templates/package/show/file",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=Ember.HTMLBars.template({id:"n+gY0z10",block:'{"symbols":[],"statements":[[4,"if",[[22,["model","isHaskellModule"]]],null,{"statements":[[0," "],[1,[26,"haskell-module",null,[["path","name","packageId","componentId","html","identifiers","occurrences","colorTheme","declarations","findReferences"],[[22,["model","id"]],[22,["model","name"]],[22,["model","packageId"]],[22,["model","componentId"]],[22,["model","sourceCodeHtml"]],[22,["model","identifiers"]],[22,["model","occurrences"]],[22,["settings","colorTheme"]],[22,["model","declarations"]],[26,"action",[[21,0,[]],"findReferences"],null]]]],false],[0,"\\n"]],"parameters":[]},{"statements":[[0," "],[1,[26,"text-file",null,[["text","path"],[[22,["model","text"]],[22,["model","id"]]]]],false],[0,"\\n"]],"parameters":[]}]],"hasEval":false}',meta:{moduleName:"haskell-code-explorer/templates/package/show/file.hbs"}})}),define("haskell-code-explorer/templates/packages",["exports"],function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=Ember.HTMLBars.template({id:"b/AToiBD",block:'{"symbols":["package","version","index"],"statements":[[6,"div"],[10,"class","flex-container container"],[8],[0,"\\n "],[6,"div"],[8],[0," \\n "],[2,"

Haskell code explorer

"],[0,"\\n "],[6,"div"],[10,"class","package-search-form"],[8],[0,"\\n "],[1,[26,"input",null,[["class","type","value","placeholder"],["form-control","text",[22,["query"]],"Package name"]]],false],[0,"\\n "],[6,"span"],[8],[0,"Number of packages : "],[1,[22,["packages","length"]],false],[9],[0,"\\n "],[9],[0,"\\n "],[9],[0,"\\n "],[6,"div"],[10,"id","packages"],[10,"class","packages"],[8],[0,"\\n "],[6,"ul"],[8],[0,"\\n"],[4,"infinite-list",null,[["containerElementId","elements","perPage"],["packages",[22,["packages"]],80]],{"statements":[[0," "],[6,"li"],[8],[0,"\\n"],[4,"each",[[21,1,["versions"]]],null,{"statements":[[4,"link-to",["package",[26,"concat",[[21,1,["name"]],"-",[21,2,[]]],null]],null,{"statements":[[4,"if",[[26,"gt",[[21,3,[]],0],null]],null,{"statements":[[0," "],[1,[21,2,[]],false],[0,"\\n"]],"parameters":[]},{"statements":[[0," "],[1,[21,1,["name"]],false],[0,"-"],[1,[21,2,[]],false],[0,"\\n"]],"parameters":[]}]],"parameters":[]},null]],"parameters":[2,3]},null],[0," "],[9],[0,"\\n"]],"parameters":[1]},null],[0," "],[9],[0,"\\n "],[9],[0,"\\n"],[9],[0,"\\n"]],"hasEval":false}',meta:{moduleName:"haskell-code-explorer/templates/packages.hbs"}})}),define("haskell-code-explorer/utils/api-urls",["exports","haskell-code-explorer/config/environment"],function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.urls=void 0 +e.urls={packageInfoUrl:function(e){return t.default.APP.staticUrlPrefix+"/"+e+"/"+t.default.APP.haskellCodeExplorerDirectory+"/packageInfo.json"},fileUrl:function(e,n){return t.default.APP.staticUrlPrefix+"/"+e+"/"+n},haskellModuleUrl:function(e,n){return t.default.APP.staticUrlPrefix+"/"+e+"/"+t.default.APP.haskellCodeExplorerDirectory+"/"+encodeURIComponent(encodeURIComponent(n))+".json"},packagesUrl:t.default.APP.apiUrlPrefix+"/packages",identifierDefinitionSiteUrl:function(e,n,o,r,i){return t.default.APP.apiUrlPrefix+"/definitionSite/"+e+"/"+o+"/"+n+"/"+r+"/"+encodeURIComponent(i).replace(/\./g,"%2E")},modulePathUrl:function(e,n,o){return t.default.APP.apiUrlPrefix+"/modulePath/"+e+"/"+o+"/"+n},expressionsUrl:function(e,n,o,r,i,l){return t.default.APP.apiUrlPrefix+"/expressions/"+e+"/"+encodeURIComponent(n)+"/"+o+"/"+r+"/"+i+"/"+l},referencesUrl:function(e,n){return t.default.APP.apiUrlPrefix+"/references/"+e+"/"+encodeURIComponent(n)},identifierSearchUrl:function(e,n){return t.default.APP.apiUrlPrefix+"/identifiers/"+e+"/"+encodeURIComponent(n).replace(/\./g,"%2E")}}}),define("haskell-code-explorer/utils/color-themes",["exports"],function(e){function t(e){return"\n body { \n color: "+e.defaultColor+" !important;\n background-color: "+e.backgroundColor+" !important;\n }\n input {\n color: "+e.defaultColor+" !important;\n background-color: "+e.backgroundColor+" !important;\n border-color: "+e.borderColor+" !important;\n }\n .package-content {\n border-top: 1px solid "+e.borderColor+" !important;\n }\n .header a {\n color : "+e.menuLinkColor+" !important;\n }\n a {\n color: "+e.typeColor+" !important;\n }\n span.link {\n color: "+e.typeColor+" !important;\n }\n .header {\n background-color: "+e.menuColor+" !important;\n border-bottom: 1px solid "+e.borderColor+" !important;\n }\n .declarations-content {\n background-color: "+e.navigationPanelColor+" !important;\n border: 1px solid "+e.borderColor+" !important;\n }\n .declarations-header {\n background-color: "+e.navigationPanelColor+" !important;\n border: 1px solid "+e.borderColor+" !important; \n }\n li.declaration {\n border-bottom: 1px solid "+e.borderColor+" !important;\n }\n .left-panel {\n background-color: "+e.navigationPanelColor+" !important;\n border-right: 1px solid "+e.borderColor+" !important;\n }\n .show-left-panel-button {\n background-color: "+e.navigationPanelColor+" !important;\n border-right:1px solid "+e.borderColor+" !important;\n border-bottom:1px solid "+e.borderColor+" !important;\n }\n .right-panel {\n background-color: "+e.backgroundColor+" !important;\n }\n a.jstree-anchor {\n color: "+e.defaultColor+" !important;\n }\n .declaration > a {\n color: "+e.defaultColor+" !important;\n }\n .highlighted-line {\n background : "+e.highlightedLineColor+" !important;\n }\n table.source-code {\n background-color: "+e.backgroundColor+" !important;\n color: "+e.defaultColor+" !important;\n }\n .jstree-clicked {\n background-color: "+e.backgroundColor+" !important;\n }\n .jstree-hovered {\n background-color: "+e.backgroundColor+" !important;\n }\n ul.autocomplete-items {\n background-color: "+e.backgroundColor+" !important;\n border-top: 1px solid "+e.borderColor+" !important;\n border-left: 1px solid "+e.borderColor+" !important;\n border-right: 1px solid "+e.borderColor+" !important;\n }\n ul.autocomplete-items > li { \n border-bottom: 1px solid "+e.borderColor+" !important;\n }\n ul.autocomplete-items > li:hover { \n background-color: "+e.highlightedLineColor+" !important;\n }\n ul.autocomplete-items > li.highlighted { \n background-color: "+e.highlightedLineColor+" !important;\n }\n .source-code-snippet {\n color: "+e.defaultColor+" !important;\n border-bottom: 1px solid "+e.borderColor+" !important;\n } \n .source-code-snippet:hover {\n background-color: "+e.highlightedLineColor+" !important;\n }\n .bottom-panel {\n background-color: "+e.backgroundColor+" !important;\n border-top: 1px solid "+e.borderColor+" !important;\n }\n .bottom-panel-header {\n border-bottom: 1px solid "+e.borderColor+" !important; \n }\n .paginated-list-header {\n border-bottom: 1px solid "+e.borderColor+" !important;\n }\n li.search-result {\n border-bottom: 1px solid "+e.borderColor+" !important;\n }\n .search-results-header {\n border-bottom: 1px solid "+e.borderColor+" !important;\n }\n .info-window-content {\n border-top: 1px solid "+e.borderColor+" !important;\n }\n .info-window {\n border: 1px solid "+e.borderColor+" !important;\n background-color:"+e.infoWindowColor+" !important;\n color: "+e.defaultColor+" !important;\n }\n .type-info {\n border-top: 1px solid "+e.borderColor+" !important;\n }"}function n(e){var n=document.createElement("style") +n.type="text/css",n.innerHTML=t(e),n.id="color-theme" +var o=document.querySelector("style#color-theme") +o&&o.parentElement.removeChild(o),document.getElementsByTagName("head")[0].appendChild(n)}Object.defineProperty(e,"__esModule",{value:!0}) +var o={id:"darkTheme",name:"Dark theme",description:"Dark theme (Monokai based)",defaultColor:"#F8F8F2",backgroundColor:"#272822",typeColor:"#66D9EF",literalColor:"#E6DB74",topLevelIdFromCurrentModule:"#A6E22E",localIdentifierColor:["#F0A3FF","#0075DC","#993F00","#2BCE48","#FFCC99","#808080","#94FFB5","#8F7C00","#C20088","#FFA405","#FFA8BB","#426600","#FF0010","#5EF1F2","#00998F","#E0FF66","#FFFF80","#FFFF00","#FF5005"],menuColor:"#3c3b37",menuLinkColor:"#F8F8F2",infoWindowColor:"#3c3b37",navigationPanelColor:"#3c3b37",linkColor:"#0366d6",borderColor:"#535557",highlightedLineColor:"#4a4a4a"},r={id:"lightTheme",name:"Light theme",description:"Light theme (Github based)",defaultColor:"#24292e",backgroundColor:"#ffffff",typeColor:"#005cc5",literalColor:"#032f62",topLevelIdFromCurrentModule:"#6f42c1",localIdentifierColor:["#005C31","#2BCE48","#808080","#8F7C00","#C20088","#FFA405","#ffa8bb","#426600","#FF0010","#09d7d8","#00998F","#990000","#FF5005"],menuColor:"#f2f4f8",menuLinkColor:"#24292e",infoWindowColor:"#f2f4f8",navigationPanelColor:"#f2f4f8",linkColor:"#0366d6",borderColor:"#e1e4e8",highlightedLineColor:"#eaeaea"},i={darkTheme:o,lightTheme:r} +e.updateColorThemeCss=n,e.colorThemeToCss=t,e.themes=i}),define("haskell-code-explorer/utils/go-to-definition",["exports"],function(e){function t(e){var t=e.modulePath,n=e.packageId.name+"-"+e.packageId.version,o="" +return 1!=e.startLine&&(o="#L"+e.startLine),"/package/"+n+"/show/"+t+o}function n(e,t){var n=t.moduleName.replace(/\./g,"-"),o=void 0 +o="Val"===t.entity?"v":"t" +var r="" +return"Val"!==t.entity&&"Typ"!==t.entity||(r="#"+o+":"+t.haddockAnchorId),"https://hackage.haskell.org/package/"+e+"/docs/"+n+".html"+r}function o(e,t){return 2===e?window.open(t,"_blank"):1==e&&(window.location=t),!1}function r(e){if(e){var t=window.location.origin+window.location.pathname+"#L"+e +location.href!=t&&(window.location.hash="#L"+e)}}function i(e,i,l,s){if("ExactLocation"===i.tag){var a=t(i) +i.startLine!==s&&r(s),o(l,a)}else if("ApproximateLocation"===i.tag){var c=i.packageId.name+"-"+i.packageId.version +"Mod"===i.entity?e.loadDefinitionSite(c,i.moduleName,i.componentId,i.entity,i.moduleName).then(function(e){var t=e.location.packageId.name+"-"+e.location.packageId.version +o(l,"/package/"+t+"/show/"+e.location.modulePath)}).catch(function(){o(l,n(c,i))}):e.loadDefinitionSite(c,i.moduleName,i.componentId,i.entity,i.name).then(function(e){if("ExactLocation"===e.location.tag){var a=t(e.location) +i.startLine!==s&&r(s),o(l,a)}else r(s),o(l,n(c,i))}).catch(function(e){console.log(e),r(s),o(l,n(c,i))})}else alert("No location info")}Object.defineProperty(e,"__esModule",{value:!0}),e.goToDefinition=i,e.openUrl=o}),define("haskell-code-explorer/utils/line-selection",["exports"],function(e){function t(e,t){var o=Array.prototype.slice.call(e.querySelectorAll("td.line-number")) +if(o.length>0){var i=function(){n(e)} +window.addEventListener("hashchange",i),t._onhashchange=i +var l=void 0,s=function(e){16===e.keyCode&&(l=!0)},a=function(e){16===e.keyCode&&(l=!1)} +document.addEventListener("keydown",s),document.addEventListener("keyup",a),t._onkeydown=s,t._onkeyup=a +var c=void 0,d=void 0 +o.forEach(function(t){t.onclick=function(){var t=parseInt(this.textContent) +l&&c?c!=t&&(d=t,co&&(n.scrollTop=n.scrollTop-(o/2-20))}function r(e,t,n){Array.prototype.slice.call(e.querySelectorAll("td.line-content")).forEach(function(e){var o=parseInt(e.id.substring(2)) +o>=t&&o<=n?e.classList.add("highlighted-line"):e.classList.remove("highlighted-line")})}Object.defineProperty(e,"__esModule",{value:!0}),e.initializeLineSelection=t,e.highlightLines=r,e.highlightSelectedLines=n}),define("haskell-code-explorer/config/environment",[],function(){try{var e="haskell-code-explorer/config/environment",t=document.querySelector('meta[name="'+e+'"]').getAttribute("content"),n=JSON.parse(unescape(t)),o={default:n} +return Object.defineProperty(o,"__esModule",{value:!0}),o}catch(t){throw new Error('Could not read config from meta tag with name "'+e+'".')}}),runningTests||require("haskell-code-explorer/app").default.create({staticUrlPrefix:"/files",apiUrlPrefix:"/api",haskellCodeExplorerDirectory:".haskell-code-explorer",title:"Haskell code explorer",name:"haskell-code-explorer",version:"0.0.1+cdeabaf8"}) diff --git a/javascript/release/assets/haskell-code-explorer-7473ab64643f48019c68ec4624ce37cb.css b/javascript/release/assets/haskell-code-explorer-7473ab64643f48019c68ec4624ce37cb.css new file mode 100644 index 0000000..25c381b --- /dev/null +++ b/javascript/release/assets/haskell-code-explorer-7473ab64643f48019c68ec4624ce37cb.css @@ -0,0 +1,6 @@ +/*! + * Bootstrap v4.1.2 (https://getbootstrap.com/) + * Copyright 2011-2018 The Bootstrap Authors + * Copyright 2011-2018 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + */dd,h1,h2,h3,h4,h5,h6{margin-bottom:.5rem}dl,ol,pre,ul{margin-top:0}address,dl,ol,p,pre,ul{margin-bottom:1rem}img,svg:not(:root){vertical-align:middle}body,caption{text-align:left}pre,textarea{overflow:auto}article,aside,figcaption,figure,footer,header,hgroup,legend,main,nav,section{display:block}address,legend{line-height:inherit}.badge,progress,sub,sup{vertical-align:baseline}button,hr,input{overflow:visible}.btn-outline-danger,.btn-outline-dark,.btn-outline-info,.btn-outline-light,.btn-outline-primary,.btn-outline-success,.btn-outline-warning,.btn:not(:disabled):not(.disabled).active,.btn:not(:disabled):not(.disabled):active{background-image:none}.dropdown-menu,.form-control,.modal-content,.popover{background-clip:padding-box}.dropdown-menu,.nav,.navbar-nav{list-style:none}:root{--blue:#007bff;--indigo:#6610f2;--purple:#6f42c1;--pink:#e83e8c;--red:#dc3545;--orange:#fd7e14;--yellow:#ffc107;--green:#28a745;--teal:#20c997;--cyan:#17a2b8;--white:#fff;--gray:#6c757d;--gray-dark:#343a40;--primary:#007bff;--secondary:#6c757d;--success:#28a745;--info:#17a2b8;--warning:#ffc107;--danger:#dc3545;--light:#f8f9fa;--dark:#343a40;--breakpoint-xs:0;--breakpoint-sm:576px;--breakpoint-md:768px;--breakpoint-lg:992px;--breakpoint-xl:1200px;--font-family-sans-serif:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";--font-family-monospace:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace}*,::after,::before{box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-ms-overflow-style:scrollbar;-webkit-tap-highlight-color:transparent}@-ms-viewport{width:device-width}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-weight:400;line-height:1.5;color:#212529;background-color:#fff}.text-monospace,code,kbd,pre,samp{font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace}[tabindex="-1"]:focus{outline:0!important}h1,h2,h3,h4,h5,h6{margin-top:0}abbr[data-original-title],abbr[title]{text-decoration:underline;text-decoration:underline dotted;cursor:help;border-bottom:0}.btn:not(:disabled):not(.disabled),.navbar-toggler:not(:disabled):not(.disabled),.page-link:not(:disabled):not(.disabled),summary{cursor:pointer}address{font-style:normal}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:700}blockquote,figure{margin:0 0 1rem}dfn{font-style:italic}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0}sub{bottom:-.25em}sup{top:-.5em}a{color:#007bff;text-decoration:none;background-color:transparent;-webkit-text-decoration-skip:objects}a:hover{color:#0056b3;text-decoration:underline}a:not([href]):not([tabindex]),a:not([href]):not([tabindex]):focus,a:not([href]):not([tabindex]):hover{color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus{outline:0}code,kbd,pre,samp{font-size:1em}pre{-ms-overflow-style:scrollbar}img{border-style:none}svg:not(:root){overflow:hidden}table{border-collapse:collapse}caption{padding-top:.75rem;padding-bottom:.75rem;color:#6c757d;caption-side:bottom}th{text-align:inherit}label,output{display:inline-block}button{border-radius:0}button:focus{outline:dotted 1px;outline:-webkit-focus-ring-color auto 5px}button,input,optgroup,select,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,select{text-transform:none}[type=submit],[type=reset],button,html [type=button]{-webkit-appearance:button}[type=submit]::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,button::-moz-focus-inner{padding:0;border-style:none}input[type=radio],input[type=checkbox]{box-sizing:border-box;padding:0}input[type=date],input[type=time],input[type=datetime-local],input[type=month]{-webkit-appearance:listbox}textarea{resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{width:100%;max-width:100%;padding:0;margin-bottom:.5rem;font-size:1.5rem;color:inherit;white-space:normal}.badge,.btn,.dropdown-header,.dropdown-item,.input-group-text,.navbar-brand,.progress-bar{white-space:nowrap}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:none}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}.display-1,.display-2,.display-3,.display-4{line-height:1.2}summary{display:list-item}template{display:none}[hidden]{display:none!important}.h1,.h2,.h3,.h4,.h5,.h6,h1,h2,h3,h4,h5,h6{margin-bottom:.5rem;font-family:inherit;font-weight:500;line-height:1.2;color:inherit}.blockquote,hr{margin-bottom:1rem}.display-1,.display-2,.display-3,.display-4,.lead{font-weight:300}.h1,h1{font-size:2.5rem}.h2,h2{font-size:2rem}.h3,h3{font-size:1.75rem}.h4,h4{font-size:1.5rem}.h5,h5{font-size:1.25rem}.h6,h6{font-size:1rem}.lead{font-size:1.25rem}.display-1{font-size:6rem}.display-2{font-size:5.5rem}.display-3{font-size:4.5rem}.display-4{font-size:3.5rem}hr{box-sizing:content-box;height:0;margin-top:1rem;border:0;border-top:1px solid rgba(0,0,0,.1)}.img-fluid,.img-thumbnail{max-width:100%;height:auto}.small,small{font-size:80%;font-weight:400}.mark,mark{padding:.2em;background-color:#fcf8e3}.list-inline,.list-unstyled{padding-left:0;list-style:none}.list-inline-item{display:inline-block}.list-inline-item:not(:last-child){margin-right:.5rem}.initialism{font-size:90%;text-transform:uppercase}.blockquote{font-size:1.25rem}.blockquote-footer{display:block;font-size:80%;color:#6c757d}.blockquote-footer::before{content:"\2014 \00A0"}.img-thumbnail{padding:.25rem;background-color:#fff;border:1px solid #dee2e6;border-radius:.25rem}.figure{display:inline-block}.figure-img{margin-bottom:.5rem;line-height:1}.figure-caption{font-size:90%;color:#6c757d}a>code,pre code{color:inherit}code{word-break:break-word}kbd{padding:.2rem .4rem;font-size:87.5%;color:#fff;background-color:#212529;border-radius:.2rem}kbd kbd{padding:0;font-size:100%;font-weight:700}.container,.container-fluid{padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto;width:100%}.btn,.btn-link,.dropdown-item{font-weight:400}pre{display:block}pre code{font-size:inherit;word-break:normal}.pre-scrollable{max-height:340px;overflow-y:scroll}@media (min-width:576px){.container{max-width:540px}}@media (min-width:768px){.container{max-width:720px}}@media (min-width:992px){.container{max-width:960px}}@media (min-width:1200px){.container{max-width:1140px}}.row{display:flex;flex-wrap:wrap;margin-right:-15px;margin-left:-15px}.no-gutters{margin-right:0;margin-left:0}.no-gutters>.col,.no-gutters>[class*=col-]{padding-right:0;padding-left:0}.col,.col-1,.col-10,.col-11,.col-12,.col-2,.col-3,.col-4,.col-5,.col-6,.col-7,.col-8,.col-9,.col-auto,.col-lg,.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-auto,.col-md,.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-auto,.col-sm,.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-auto,.col-xl,.col-xl-1,.col-xl-10,.col-xl-11,.col-xl-12,.col-xl-2,.col-xl-3,.col-xl-4,.col-xl-5,.col-xl-6,.col-xl-7,.col-xl-8,.col-xl-9,.col-xl-auto{position:relative;width:100%;min-height:1px;padding-right:15px;padding-left:15px}.col{flex-basis:0;flex-grow:1;max-width:100%}.col-auto{flex:0 0 auto;width:auto;max-width:none}.col-1{flex:0 0 8.33333%;max-width:8.33333%}.col-2{flex:0 0 16.66667%;max-width:16.66667%}.col-3{flex:0 0 25%;max-width:25%}.col-4{flex:0 0 33.33333%;max-width:33.33333%}.col-5{flex:0 0 41.66667%;max-width:41.66667%}.col-6{flex:0 0 50%;max-width:50%}.col-7{flex:0 0 58.33333%;max-width:58.33333%}.col-8{flex:0 0 66.66667%;max-width:66.66667%}.col-9{flex:0 0 75%;max-width:75%}.col-10{flex:0 0 83.33333%;max-width:83.33333%}.col-11{flex:0 0 91.66667%;max-width:91.66667%}.col-12{flex:0 0 100%;max-width:100%}.order-first{order:-1}.order-last{order:13}.order-0{order:0}.order-1{order:1}.order-2{order:2}.order-3{order:3}.order-4{order:4}.order-5{order:5}.order-6{order:6}.order-7{order:7}.order-8{order:8}.order-9{order:9}.order-10{order:10}.order-11{order:11}.order-12{order:12}.offset-1{margin-left:8.33333%}.offset-2{margin-left:16.66667%}.offset-3{margin-left:25%}.offset-4{margin-left:33.33333%}.offset-5{margin-left:41.66667%}.offset-6{margin-left:50%}.offset-7{margin-left:58.33333%}.offset-8{margin-left:66.66667%}.offset-9{margin-left:75%}.offset-10{margin-left:83.33333%}.offset-11{margin-left:91.66667%}@media (min-width:576px){.col-sm{flex-basis:0;flex-grow:1;max-width:100%}.col-sm-auto{flex:0 0 auto;width:auto;max-width:none}.col-sm-1{flex:0 0 8.33333%;max-width:8.33333%}.col-sm-2{flex:0 0 16.66667%;max-width:16.66667%}.col-sm-3{flex:0 0 25%;max-width:25%}.col-sm-4{flex:0 0 33.33333%;max-width:33.33333%}.col-sm-5{flex:0 0 41.66667%;max-width:41.66667%}.col-sm-6{flex:0 0 50%;max-width:50%}.col-sm-7{flex:0 0 58.33333%;max-width:58.33333%}.col-sm-8{flex:0 0 66.66667%;max-width:66.66667%}.col-sm-9{flex:0 0 75%;max-width:75%}.col-sm-10{flex:0 0 83.33333%;max-width:83.33333%}.col-sm-11{flex:0 0 91.66667%;max-width:91.66667%}.col-sm-12{flex:0 0 100%;max-width:100%}.order-sm-first{order:-1}.order-sm-last{order:13}.order-sm-0{order:0}.order-sm-1{order:1}.order-sm-2{order:2}.order-sm-3{order:3}.order-sm-4{order:4}.order-sm-5{order:5}.order-sm-6{order:6}.order-sm-7{order:7}.order-sm-8{order:8}.order-sm-9{order:9}.order-sm-10{order:10}.order-sm-11{order:11}.order-sm-12{order:12}.offset-sm-0{margin-left:0}.offset-sm-1{margin-left:8.33333%}.offset-sm-2{margin-left:16.66667%}.offset-sm-3{margin-left:25%}.offset-sm-4{margin-left:33.33333%}.offset-sm-5{margin-left:41.66667%}.offset-sm-6{margin-left:50%}.offset-sm-7{margin-left:58.33333%}.offset-sm-8{margin-left:66.66667%}.offset-sm-9{margin-left:75%}.offset-sm-10{margin-left:83.33333%}.offset-sm-11{margin-left:91.66667%}}@media (min-width:768px){.col-md{flex-basis:0;flex-grow:1;max-width:100%}.col-md-auto{flex:0 0 auto;width:auto;max-width:none}.col-md-1{flex:0 0 8.33333%;max-width:8.33333%}.col-md-2{flex:0 0 16.66667%;max-width:16.66667%}.col-md-3{flex:0 0 25%;max-width:25%}.col-md-4{flex:0 0 33.33333%;max-width:33.33333%}.col-md-5{flex:0 0 41.66667%;max-width:41.66667%}.col-md-6{flex:0 0 50%;max-width:50%}.col-md-7{flex:0 0 58.33333%;max-width:58.33333%}.col-md-8{flex:0 0 66.66667%;max-width:66.66667%}.col-md-9{flex:0 0 75%;max-width:75%}.col-md-10{flex:0 0 83.33333%;max-width:83.33333%}.col-md-11{flex:0 0 91.66667%;max-width:91.66667%}.col-md-12{flex:0 0 100%;max-width:100%}.order-md-first{order:-1}.order-md-last{order:13}.order-md-0{order:0}.order-md-1{order:1}.order-md-2{order:2}.order-md-3{order:3}.order-md-4{order:4}.order-md-5{order:5}.order-md-6{order:6}.order-md-7{order:7}.order-md-8{order:8}.order-md-9{order:9}.order-md-10{order:10}.order-md-11{order:11}.order-md-12{order:12}.offset-md-0{margin-left:0}.offset-md-1{margin-left:8.33333%}.offset-md-2{margin-left:16.66667%}.offset-md-3{margin-left:25%}.offset-md-4{margin-left:33.33333%}.offset-md-5{margin-left:41.66667%}.offset-md-6{margin-left:50%}.offset-md-7{margin-left:58.33333%}.offset-md-8{margin-left:66.66667%}.offset-md-9{margin-left:75%}.offset-md-10{margin-left:83.33333%}.offset-md-11{margin-left:91.66667%}}@media (min-width:992px){.col-lg{flex-basis:0;flex-grow:1;max-width:100%}.col-lg-auto{flex:0 0 auto;width:auto;max-width:none}.col-lg-1{flex:0 0 8.33333%;max-width:8.33333%}.col-lg-2{flex:0 0 16.66667%;max-width:16.66667%}.col-lg-3{flex:0 0 25%;max-width:25%}.col-lg-4{flex:0 0 33.33333%;max-width:33.33333%}.col-lg-5{flex:0 0 41.66667%;max-width:41.66667%}.col-lg-6{flex:0 0 50%;max-width:50%}.col-lg-7{flex:0 0 58.33333%;max-width:58.33333%}.col-lg-8{flex:0 0 66.66667%;max-width:66.66667%}.col-lg-9{flex:0 0 75%;max-width:75%}.col-lg-10{flex:0 0 83.33333%;max-width:83.33333%}.col-lg-11{flex:0 0 91.66667%;max-width:91.66667%}.col-lg-12{flex:0 0 100%;max-width:100%}.order-lg-first{order:-1}.order-lg-last{order:13}.order-lg-0{order:0}.order-lg-1{order:1}.order-lg-2{order:2}.order-lg-3{order:3}.order-lg-4{order:4}.order-lg-5{order:5}.order-lg-6{order:6}.order-lg-7{order:7}.order-lg-8{order:8}.order-lg-9{order:9}.order-lg-10{order:10}.order-lg-11{order:11}.order-lg-12{order:12}.offset-lg-0{margin-left:0}.offset-lg-1{margin-left:8.33333%}.offset-lg-2{margin-left:16.66667%}.offset-lg-3{margin-left:25%}.offset-lg-4{margin-left:33.33333%}.offset-lg-5{margin-left:41.66667%}.offset-lg-6{margin-left:50%}.offset-lg-7{margin-left:58.33333%}.offset-lg-8{margin-left:66.66667%}.offset-lg-9{margin-left:75%}.offset-lg-10{margin-left:83.33333%}.offset-lg-11{margin-left:91.66667%}}@media (min-width:1200px){.col-xl{flex-basis:0;flex-grow:1;max-width:100%}.col-xl-auto{flex:0 0 auto;width:auto;max-width:none}.col-xl-1{flex:0 0 8.33333%;max-width:8.33333%}.col-xl-2{flex:0 0 16.66667%;max-width:16.66667%}.col-xl-3{flex:0 0 25%;max-width:25%}.col-xl-4{flex:0 0 33.33333%;max-width:33.33333%}.col-xl-5{flex:0 0 41.66667%;max-width:41.66667%}.col-xl-6{flex:0 0 50%;max-width:50%}.col-xl-7{flex:0 0 58.33333%;max-width:58.33333%}.col-xl-8{flex:0 0 66.66667%;max-width:66.66667%}.col-xl-9{flex:0 0 75%;max-width:75%}.col-xl-10{flex:0 0 83.33333%;max-width:83.33333%}.col-xl-11{flex:0 0 91.66667%;max-width:91.66667%}.col-xl-12{flex:0 0 100%;max-width:100%}.order-xl-first{order:-1}.order-xl-last{order:13}.order-xl-0{order:0}.order-xl-1{order:1}.order-xl-2{order:2}.order-xl-3{order:3}.order-xl-4{order:4}.order-xl-5{order:5}.order-xl-6{order:6}.order-xl-7{order:7}.order-xl-8{order:8}.order-xl-9{order:9}.order-xl-10{order:10}.order-xl-11{order:11}.order-xl-12{order:12}.offset-xl-0{margin-left:0}.offset-xl-1{margin-left:8.33333%}.offset-xl-2{margin-left:16.66667%}.offset-xl-3{margin-left:25%}.offset-xl-4{margin-left:33.33333%}.offset-xl-5{margin-left:41.66667%}.offset-xl-6{margin-left:50%}.offset-xl-7{margin-left:58.33333%}.offset-xl-8{margin-left:66.66667%}.offset-xl-9{margin-left:75%}.offset-xl-10{margin-left:83.33333%}.offset-xl-11{margin-left:91.66667%}}.table{width:100%;max-width:100%;margin-bottom:1rem;background-color:transparent}.table td,.table th{padding:.75rem;vertical-align:top;border-top:1px solid #dee2e6}.table thead th{vertical-align:bottom;border-bottom:2px solid #dee2e6}.table tbody+tbody{border-top:2px solid #dee2e6}.table .table{background-color:#fff}.table-sm td,.table-sm th{padding:.3rem}.table-bordered,.table-bordered td,.table-bordered th{border:1px solid #dee2e6}.table-bordered thead td,.table-bordered thead th{border-bottom-width:2px}.table-borderless tbody+tbody,.table-borderless td,.table-borderless th,.table-borderless thead th{border:0}.table-striped tbody tr:nth-of-type(odd){background-color:rgba(0,0,0,.05)}.table-hover tbody tr:hover{background-color:rgba(0,0,0,.075)}.table-primary,.table-primary>td,.table-primary>th{background-color:#b8daff}.table-hover .table-primary:hover,.table-hover .table-primary:hover>td,.table-hover .table-primary:hover>th{background-color:#9fcdff}.table-secondary,.table-secondary>td,.table-secondary>th{background-color:#d6d8db}.table-hover .table-secondary:hover,.table-hover .table-secondary:hover>td,.table-hover .table-secondary:hover>th{background-color:#c8cbcf}.table-success,.table-success>td,.table-success>th{background-color:#c3e6cb}.table-hover .table-success:hover,.table-hover .table-success:hover>td,.table-hover .table-success:hover>th{background-color:#b1dfbb}.table-info,.table-info>td,.table-info>th{background-color:#bee5eb}.table-hover .table-info:hover,.table-hover .table-info:hover>td,.table-hover .table-info:hover>th{background-color:#abdde5}.table-warning,.table-warning>td,.table-warning>th{background-color:#ffeeba}.table-hover .table-warning:hover,.table-hover .table-warning:hover>td,.table-hover .table-warning:hover>th{background-color:#ffe8a1}.table-danger,.table-danger>td,.table-danger>th{background-color:#f5c6cb}.table-hover .table-danger:hover,.table-hover .table-danger:hover>td,.table-hover .table-danger:hover>th{background-color:#f1b0b7}.table-light,.table-light>td,.table-light>th{background-color:#fdfdfe}.table-hover .table-light:hover,.table-hover .table-light:hover>td,.table-hover .table-light:hover>th{background-color:#ececf6}.table-dark,.table-dark>td,.table-dark>th{background-color:#c6c8ca}.table-hover .table-dark:hover,.table-hover .table-dark:hover>td,.table-hover .table-dark:hover>th{background-color:#b9bbbe}.table-active,.table-active>td,.table-active>th,.table-hover .table-active:hover,.table-hover .table-active:hover>td,.table-hover .table-active:hover>th{background-color:rgba(0,0,0,.075)}.table .thead-dark th{color:#fff;background-color:#212529;border-color:#32383e}.table .thead-light th{color:#495057;background-color:#e9ecef;border-color:#dee2e6}.table-dark{color:#fff;background-color:#212529}.table-dark td,.table-dark th,.table-dark thead th{border-color:#32383e}.table-dark.table-bordered,.table-responsive>.table-bordered{border:0}.table-dark.table-striped tbody tr:nth-of-type(odd){background-color:rgba(255,255,255,.05)}.table-dark.table-hover tbody tr:hover{background-color:rgba(255,255,255,.075)}@media (max-width:575.98px){.table-responsive-sm{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;-ms-overflow-style:-ms-autohiding-scrollbar}.table-responsive-sm>.table-bordered{border:0}}@media (max-width:767.98px){.table-responsive-md{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;-ms-overflow-style:-ms-autohiding-scrollbar}.table-responsive-md>.table-bordered{border:0}}@media (max-width:991.98px){.table-responsive-lg{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;-ms-overflow-style:-ms-autohiding-scrollbar}.table-responsive-lg>.table-bordered{border:0}}@media (max-width:1199.98px){.table-responsive-xl{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;-ms-overflow-style:-ms-autohiding-scrollbar}.table-responsive-xl>.table-bordered{border:0}}.table-responsive{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;-ms-overflow-style:-ms-autohiding-scrollbar}.collapsing,.modal,.modal-open,.progress{overflow:hidden}.form-control{display:block;width:100%;padding:.375rem .75rem;font-size:1rem;line-height:1.5;color:#495057;background-color:#fff;border:1px solid #ced4da;border-radius:.25rem;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out}@media screen and (prefers-reduced-motion:reduce){.form-control{transition:none}}.form-control::-ms-expand{background-color:transparent;border:0}.form-control:focus{color:#495057;background-color:#fff;border-color:#80bdff;outline:0;box-shadow:0 0 0 .2rem rgba(0,123,255,.25)}.form-control::placeholder{color:#6c757d;opacity:1}.form-control:disabled,.form-control[readonly]{background-color:#e9ecef;opacity:1}select.form-control:not([size]):not([multiple]){height:calc(2.25rem + 2px)}select.form-control:focus::-ms-value{color:#495057;background-color:#fff}.form-control-file,.form-control-range{display:block;width:100%}.col-form-label{padding-top:calc(.375rem + 1px);padding-bottom:calc(.375rem + 1px);margin-bottom:0;font-size:inherit;line-height:1.5}.col-form-label-lg{padding-top:calc(.5rem + 1px);padding-bottom:calc(.5rem + 1px);font-size:1.25rem;line-height:1.5}.col-form-label-sm{padding-top:calc(.25rem + 1px);padding-bottom:calc(.25rem + 1px);font-size:.875rem;line-height:1.5}.form-control-plaintext{display:block;width:100%;padding-top:.375rem;padding-bottom:.375rem;margin-bottom:0;line-height:1.5;color:#212529;background-color:transparent;border:solid transparent;border-width:1px 0}.custom-file-input.is-valid~.custom-file-label,.custom-select.is-valid,.form-control.is-valid,.was-validated .custom-file-input:valid~.custom-file-label,.was-validated .custom-select:valid,.was-validated .form-control:valid{border-color:#28a745}.form-control-plaintext.form-control-lg,.form-control-plaintext.form-control-sm,.input-group-lg>.form-control-plaintext.form-control,.input-group-lg>.input-group-append>.form-control-plaintext.btn,.input-group-lg>.input-group-append>.form-control-plaintext.input-group-text,.input-group-lg>.input-group-prepend>.form-control-plaintext.btn,.input-group-lg>.input-group-prepend>.form-control-plaintext.input-group-text,.input-group-sm>.form-control-plaintext.form-control,.input-group-sm>.input-group-append>.form-control-plaintext.btn,.input-group-sm>.input-group-append>.form-control-plaintext.input-group-text,.input-group-sm>.input-group-prepend>.form-control-plaintext.btn,.input-group-sm>.input-group-prepend>.form-control-plaintext.input-group-text{padding-right:0;padding-left:0}.form-control-sm,.input-group-sm>.form-control,.input-group-sm>.input-group-append>.btn,.input-group-sm>.input-group-append>.input-group-text,.input-group-sm>.input-group-prepend>.btn,.input-group-sm>.input-group-prepend>.input-group-text{padding:.25rem .5rem;font-size:.875rem;line-height:1.5;border-radius:.2rem}.input-group-sm>.input-group-append>select.btn:not([size]):not([multiple]),.input-group-sm>.input-group-append>select.input-group-text:not([size]):not([multiple]),.input-group-sm>.input-group-prepend>select.btn:not([size]):not([multiple]),.input-group-sm>.input-group-prepend>select.input-group-text:not([size]):not([multiple]),.input-group-sm>select.form-control:not([size]):not([multiple]),select.form-control-sm:not([size]):not([multiple]){height:calc(1.8125rem + 2px)}.form-control-lg,.input-group-lg>.form-control,.input-group-lg>.input-group-append>.btn,.input-group-lg>.input-group-append>.input-group-text,.input-group-lg>.input-group-prepend>.btn,.input-group-lg>.input-group-prepend>.input-group-text{padding:.5rem 1rem;font-size:1.25rem;line-height:1.5;border-radius:.3rem}.input-group-lg>.input-group-append>select.btn:not([size]):not([multiple]),.input-group-lg>.input-group-append>select.input-group-text:not([size]):not([multiple]),.input-group-lg>.input-group-prepend>select.btn:not([size]):not([multiple]),.input-group-lg>.input-group-prepend>select.input-group-text:not([size]):not([multiple]),.input-group-lg>select.form-control:not([size]):not([multiple]),select.form-control-lg:not([size]):not([multiple]){height:calc(2.875rem + 2px)}.form-group{margin-bottom:1rem}.form-text{display:block;margin-top:.25rem}.form-row{display:flex;flex-wrap:wrap;margin-right:-5px;margin-left:-5px}.form-row>.col,.form-row>[class*=col-]{padding-right:5px;padding-left:5px}.form-check{position:relative;display:block;padding-left:1.25rem}.form-check-input{position:absolute;margin-top:.3rem;margin-left:-1.25rem}.form-check-input:disabled~.form-check-label{color:#6c757d}.form-check-label{margin-bottom:0}.form-check-inline{display:inline-flex;align-items:center;padding-left:0;margin-right:.75rem}.form-check-inline .form-check-input{position:static;margin-top:0;margin-right:.3125rem;margin-left:0}.invalid-tooltip,.valid-tooltip{position:absolute;z-index:5;max-width:100%;padding:.5rem;line-height:1;border-radius:.2rem;top:100%}.valid-feedback{display:none;width:100%;margin-top:.25rem;font-size:80%;color:#28a745}.valid-tooltip{display:none;margin-top:.1rem;font-size:.875rem;color:#fff;background-color:rgba(40,167,69,.8)}.custom-control-input.is-valid~.valid-feedback,.custom-control-input.is-valid~.valid-tooltip,.custom-file-input.is-valid~.valid-feedback,.custom-file-input.is-valid~.valid-tooltip,.custom-select.is-valid~.valid-feedback,.custom-select.is-valid~.valid-tooltip,.form-check-input.is-valid~.valid-feedback,.form-check-input.is-valid~.valid-tooltip,.form-control-file.is-valid~.valid-feedback,.form-control-file.is-valid~.valid-tooltip,.form-control.is-valid~.valid-feedback,.form-control.is-valid~.valid-tooltip,.was-validated .custom-control-input:valid~.valid-feedback,.was-validated .custom-control-input:valid~.valid-tooltip,.was-validated .custom-file-input:valid~.valid-feedback,.was-validated .custom-file-input:valid~.valid-tooltip,.was-validated .custom-select:valid~.valid-feedback,.was-validated .custom-select:valid~.valid-tooltip,.was-validated .form-check-input:valid~.valid-feedback,.was-validated .form-check-input:valid~.valid-tooltip,.was-validated .form-control-file:valid~.valid-feedback,.was-validated .form-control-file:valid~.valid-tooltip,.was-validated .form-control:valid~.valid-feedback,.was-validated .form-control:valid~.valid-tooltip{display:block}.custom-control-input.is-valid~.custom-control-label,.form-check-input.is-valid~.form-check-label,.was-validated .custom-control-input:valid~.custom-control-label,.was-validated .form-check-input:valid~.form-check-label{color:#28a745}.custom-select.is-valid:focus,.form-control.is-valid:focus,.was-validated .custom-select:valid:focus,.was-validated .form-control:valid:focus{border-color:#28a745;box-shadow:0 0 0 .2rem rgba(40,167,69,.25)}.custom-control-input.is-valid~.custom-control-label::before,.was-validated .custom-control-input:valid~.custom-control-label::before{background-color:#71dd8a}.custom-control-input.is-valid:checked~.custom-control-label::before,.was-validated .custom-control-input:valid:checked~.custom-control-label::before{background-color:#34ce57}.custom-control-input.is-valid:focus~.custom-control-label::before,.was-validated .custom-control-input:valid:focus~.custom-control-label::before{box-shadow:0 0 0 1px #fff,0 0 0 .2rem rgba(40,167,69,.25)}.custom-file-input.is-valid~.custom-file-label::before,.was-validated .custom-file-input:valid~.custom-file-label::before{border-color:inherit}.custom-file-input.is-invalid~.custom-file-label,.custom-select.is-invalid,.form-control.is-invalid,.was-validated .custom-file-input:invalid~.custom-file-label,.was-validated .custom-select:invalid,.was-validated .form-control:invalid{border-color:#dc3545}.custom-file-input.is-valid:focus~.custom-file-label,.was-validated .custom-file-input:valid:focus~.custom-file-label{box-shadow:0 0 0 .2rem rgba(40,167,69,.25)}.invalid-feedback{display:none;width:100%;margin-top:.25rem;font-size:80%;color:#dc3545}.invalid-tooltip{display:none;margin-top:.1rem;font-size:.875rem;color:#fff;background-color:rgba(220,53,69,.8)}.collapsing,.dropdown,.dropleft,.dropright,.dropup{position:relative}.custom-control-input.is-invalid~.invalid-feedback,.custom-control-input.is-invalid~.invalid-tooltip,.custom-file-input.is-invalid~.invalid-feedback,.custom-file-input.is-invalid~.invalid-tooltip,.custom-select.is-invalid~.invalid-feedback,.custom-select.is-invalid~.invalid-tooltip,.form-check-input.is-invalid~.invalid-feedback,.form-check-input.is-invalid~.invalid-tooltip,.form-control-file.is-invalid~.invalid-feedback,.form-control-file.is-invalid~.invalid-tooltip,.form-control.is-invalid~.invalid-feedback,.form-control.is-invalid~.invalid-tooltip,.was-validated .custom-control-input:invalid~.invalid-feedback,.was-validated .custom-control-input:invalid~.invalid-tooltip,.was-validated .custom-file-input:invalid~.invalid-feedback,.was-validated .custom-file-input:invalid~.invalid-tooltip,.was-validated .custom-select:invalid~.invalid-feedback,.was-validated .custom-select:invalid~.invalid-tooltip,.was-validated .form-check-input:invalid~.invalid-feedback,.was-validated .form-check-input:invalid~.invalid-tooltip,.was-validated .form-control-file:invalid~.invalid-feedback,.was-validated .form-control-file:invalid~.invalid-tooltip,.was-validated .form-control:invalid~.invalid-feedback,.was-validated .form-control:invalid~.invalid-tooltip{display:block}.custom-control-input.is-invalid~.custom-control-label,.form-check-input.is-invalid~.form-check-label,.was-validated .custom-control-input:invalid~.custom-control-label,.was-validated .form-check-input:invalid~.form-check-label{color:#dc3545}.custom-select.is-invalid:focus,.form-control.is-invalid:focus,.was-validated .custom-select:invalid:focus,.was-validated .form-control:invalid:focus{border-color:#dc3545;box-shadow:0 0 0 .2rem rgba(220,53,69,.25)}.custom-control-input.is-invalid~.custom-control-label::before,.was-validated .custom-control-input:invalid~.custom-control-label::before{background-color:#efa2a9}.custom-control-input.is-invalid:checked~.custom-control-label::before,.was-validated .custom-control-input:invalid:checked~.custom-control-label::before{background-color:#e4606d}.custom-control-input.is-invalid:focus~.custom-control-label::before,.was-validated .custom-control-input:invalid:focus~.custom-control-label::before{box-shadow:0 0 0 1px #fff,0 0 0 .2rem rgba(220,53,69,.25)}.custom-file-input.is-invalid~.custom-file-label::before,.was-validated .custom-file-input:invalid~.custom-file-label::before{border-color:inherit}.custom-file-input.is-invalid:focus~.custom-file-label,.was-validated .custom-file-input:invalid:focus~.custom-file-label{box-shadow:0 0 0 .2rem rgba(220,53,69,.25)}.form-inline{display:flex;flex-flow:row wrap;align-items:center}.form-inline .form-check{width:100%}@media (min-width:576px){.form-inline label{display:flex;align-items:center;justify-content:center;margin-bottom:0}.form-inline .form-group{display:flex;flex:0 0 auto;flex-flow:row wrap;align-items:center;margin-bottom:0}.form-inline .form-control{display:inline-block;width:auto;vertical-align:middle}.form-inline .form-control-plaintext{display:inline-block}.form-inline .custom-select,.form-inline .input-group{width:auto}.form-inline .form-check{display:flex;align-items:center;justify-content:center;width:auto;padding-left:0}.form-inline .form-check-input{position:relative;margin-top:0;margin-right:.25rem;margin-left:0}.form-inline .custom-control{align-items:center;justify-content:center}.form-inline .custom-control-label{margin-bottom:0}}.btn-block,input[type=submit].btn-block,input[type=button].btn-block,input[type=reset].btn-block{width:100%}.btn{display:inline-block;text-align:center;vertical-align:middle;user-select:none;border:1px solid transparent;padding:.375rem .75rem;font-size:1rem;line-height:1.5;border-radius:.25rem;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out}@media screen and (prefers-reduced-motion:reduce){.btn{transition:none}}.btn:focus,.btn:hover{text-decoration:none}.btn.focus,.btn:focus{outline:0;box-shadow:0 0 0 .2rem rgba(0,123,255,.25)}.btn-primary.focus,.btn-primary:focus,.btn-primary:not(:disabled):not(.disabled).active:focus,.btn-primary:not(:disabled):not(.disabled):active:focus,.show>.btn-primary.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(0,123,255,.5)}.btn.disabled,.btn:disabled{opacity:.65}a.btn.disabled,fieldset:disabled a.btn{pointer-events:none}.btn-primary{color:#fff;background-color:#007bff;border-color:#007bff}.btn-primary:hover{color:#fff;background-color:#0069d9;border-color:#0062cc}.btn-primary.disabled,.btn-primary:disabled{color:#fff;background-color:#007bff;border-color:#007bff}.btn-primary:not(:disabled):not(.disabled).active,.btn-primary:not(:disabled):not(.disabled):active,.show>.btn-primary.dropdown-toggle{color:#fff;background-color:#0062cc;border-color:#005cbf}.btn-secondary.focus,.btn-secondary:focus,.btn-secondary:not(:disabled):not(.disabled).active:focus,.btn-secondary:not(:disabled):not(.disabled):active:focus,.show>.btn-secondary.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(108,117,125,.5)}.btn-secondary{color:#fff;background-color:#6c757d;border-color:#6c757d}.btn-secondary:hover{color:#fff;background-color:#5a6268;border-color:#545b62}.btn-secondary.disabled,.btn-secondary:disabled{color:#fff;background-color:#6c757d;border-color:#6c757d}.btn-secondary:not(:disabled):not(.disabled).active,.btn-secondary:not(:disabled):not(.disabled):active,.show>.btn-secondary.dropdown-toggle{color:#fff;background-color:#545b62;border-color:#4e555b}.btn-success.focus,.btn-success:focus,.btn-success:not(:disabled):not(.disabled).active:focus,.btn-success:not(:disabled):not(.disabled):active:focus,.show>.btn-success.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(40,167,69,.5)}.btn-success{color:#fff;background-color:#28a745;border-color:#28a745}.btn-success:hover{color:#fff;background-color:#218838;border-color:#1e7e34}.btn-success.disabled,.btn-success:disabled{color:#fff;background-color:#28a745;border-color:#28a745}.btn-success:not(:disabled):not(.disabled).active,.btn-success:not(:disabled):not(.disabled):active,.show>.btn-success.dropdown-toggle{color:#fff;background-color:#1e7e34;border-color:#1c7430}.btn-info.focus,.btn-info:focus,.btn-info:not(:disabled):not(.disabled).active:focus,.btn-info:not(:disabled):not(.disabled):active:focus,.show>.btn-info.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(23,162,184,.5)}.btn-info{color:#fff;background-color:#17a2b8;border-color:#17a2b8}.btn-info:hover{color:#fff;background-color:#138496;border-color:#117a8b}.btn-info.disabled,.btn-info:disabled{color:#fff;background-color:#17a2b8;border-color:#17a2b8}.btn-info:not(:disabled):not(.disabled).active,.btn-info:not(:disabled):not(.disabled):active,.show>.btn-info.dropdown-toggle{color:#fff;background-color:#117a8b;border-color:#10707f}.btn-warning.focus,.btn-warning:focus,.btn-warning:not(:disabled):not(.disabled).active:focus,.btn-warning:not(:disabled):not(.disabled):active:focus,.show>.btn-warning.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(255,193,7,.5)}.btn-warning{color:#212529;background-color:#ffc107;border-color:#ffc107}.btn-warning:hover{color:#212529;background-color:#e0a800;border-color:#d39e00}.btn-warning.disabled,.btn-warning:disabled{color:#212529;background-color:#ffc107;border-color:#ffc107}.btn-warning:not(:disabled):not(.disabled).active,.btn-warning:not(:disabled):not(.disabled):active,.show>.btn-warning.dropdown-toggle{color:#212529;background-color:#d39e00;border-color:#c69500}.btn-danger.focus,.btn-danger:focus,.btn-danger:not(:disabled):not(.disabled).active:focus,.btn-danger:not(:disabled):not(.disabled):active:focus,.show>.btn-danger.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(220,53,69,.5)}.btn-danger{color:#fff;background-color:#dc3545;border-color:#dc3545}.btn-danger:hover{color:#fff;background-color:#c82333;border-color:#bd2130}.btn-danger.disabled,.btn-danger:disabled{color:#fff;background-color:#dc3545;border-color:#dc3545}.btn-danger:not(:disabled):not(.disabled).active,.btn-danger:not(:disabled):not(.disabled):active,.show>.btn-danger.dropdown-toggle{color:#fff;background-color:#bd2130;border-color:#b21f2d}.btn-light.focus,.btn-light:focus,.btn-light:not(:disabled):not(.disabled).active:focus,.btn-light:not(:disabled):not(.disabled):active:focus,.show>.btn-light.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(248,249,250,.5)}.btn-light{color:#212529;background-color:#f8f9fa;border-color:#f8f9fa}.btn-light:hover{color:#212529;background-color:#e2e6ea;border-color:#dae0e5}.btn-light.disabled,.btn-light:disabled{color:#212529;background-color:#f8f9fa;border-color:#f8f9fa}.btn-light:not(:disabled):not(.disabled).active,.btn-light:not(:disabled):not(.disabled):active,.show>.btn-light.dropdown-toggle{color:#212529;background-color:#dae0e5;border-color:#d3d9df}.btn-dark.focus,.btn-dark:focus,.btn-dark:not(:disabled):not(.disabled).active:focus,.btn-dark:not(:disabled):not(.disabled):active:focus,.show>.btn-dark.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(52,58,64,.5)}.btn-dark{color:#fff;background-color:#343a40;border-color:#343a40}.btn-dark:hover{color:#fff;background-color:#23272b;border-color:#1d2124}.btn-dark.disabled,.btn-dark:disabled{color:#fff;background-color:#343a40;border-color:#343a40}.btn-dark:not(:disabled):not(.disabled).active,.btn-dark:not(:disabled):not(.disabled):active,.show>.btn-dark.dropdown-toggle{color:#fff;background-color:#1d2124;border-color:#171a1d}.btn-outline-primary.focus,.btn-outline-primary:focus,.btn-outline-primary:not(:disabled):not(.disabled).active:focus,.btn-outline-primary:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-primary.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(0,123,255,.5)}.btn-outline-primary{color:#007bff;background-color:transparent;border-color:#007bff}.btn-outline-primary:hover{color:#fff;background-color:#007bff;border-color:#007bff}.btn-outline-primary.disabled,.btn-outline-primary:disabled{color:#007bff;background-color:transparent}.btn-outline-primary:not(:disabled):not(.disabled).active,.btn-outline-primary:not(:disabled):not(.disabled):active,.show>.btn-outline-primary.dropdown-toggle{color:#fff;background-color:#007bff;border-color:#007bff}.btn-outline-secondary.focus,.btn-outline-secondary:focus,.btn-outline-secondary:not(:disabled):not(.disabled).active:focus,.btn-outline-secondary:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-secondary.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(108,117,125,.5)}.btn-outline-secondary{color:#6c757d;background-color:transparent;background-image:none;border-color:#6c757d}.btn-outline-secondary:hover{color:#fff;background-color:#6c757d;border-color:#6c757d}.btn-outline-secondary.disabled,.btn-outline-secondary:disabled{color:#6c757d;background-color:transparent}.btn-outline-secondary:not(:disabled):not(.disabled).active,.btn-outline-secondary:not(:disabled):not(.disabled):active,.show>.btn-outline-secondary.dropdown-toggle{color:#fff;background-color:#6c757d;border-color:#6c757d}.btn-outline-success.focus,.btn-outline-success:focus,.btn-outline-success:not(:disabled):not(.disabled).active:focus,.btn-outline-success:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-success.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(40,167,69,.5)}.btn-outline-success{color:#28a745;background-color:transparent;border-color:#28a745}.btn-outline-success:hover{color:#fff;background-color:#28a745;border-color:#28a745}.btn-outline-success.disabled,.btn-outline-success:disabled{color:#28a745;background-color:transparent}.btn-outline-success:not(:disabled):not(.disabled).active,.btn-outline-success:not(:disabled):not(.disabled):active,.show>.btn-outline-success.dropdown-toggle{color:#fff;background-color:#28a745;border-color:#28a745}.btn-outline-info.focus,.btn-outline-info:focus,.btn-outline-info:not(:disabled):not(.disabled).active:focus,.btn-outline-info:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-info.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(23,162,184,.5)}.btn-outline-info{color:#17a2b8;background-color:transparent;border-color:#17a2b8}.btn-outline-info:hover{color:#fff;background-color:#17a2b8;border-color:#17a2b8}.btn-outline-info.disabled,.btn-outline-info:disabled{color:#17a2b8;background-color:transparent}.btn-outline-info:not(:disabled):not(.disabled).active,.btn-outline-info:not(:disabled):not(.disabled):active,.show>.btn-outline-info.dropdown-toggle{color:#fff;background-color:#17a2b8;border-color:#17a2b8}.btn-outline-warning.focus,.btn-outline-warning:focus,.btn-outline-warning:not(:disabled):not(.disabled).active:focus,.btn-outline-warning:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-warning.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(255,193,7,.5)}.btn-outline-warning{color:#ffc107;background-color:transparent;border-color:#ffc107}.btn-outline-warning:hover{color:#212529;background-color:#ffc107;border-color:#ffc107}.btn-outline-warning.disabled,.btn-outline-warning:disabled{color:#ffc107;background-color:transparent}.btn-outline-warning:not(:disabled):not(.disabled).active,.btn-outline-warning:not(:disabled):not(.disabled):active,.show>.btn-outline-warning.dropdown-toggle{color:#212529;background-color:#ffc107;border-color:#ffc107}.btn-outline-danger.focus,.btn-outline-danger:focus,.btn-outline-danger:not(:disabled):not(.disabled).active:focus,.btn-outline-danger:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-danger.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(220,53,69,.5)}.btn-outline-danger{color:#dc3545;background-color:transparent;border-color:#dc3545}.btn-outline-danger:hover{color:#fff;background-color:#dc3545;border-color:#dc3545}.btn-outline-danger.disabled,.btn-outline-danger:disabled{color:#dc3545;background-color:transparent}.btn-outline-danger:not(:disabled):not(.disabled).active,.btn-outline-danger:not(:disabled):not(.disabled):active,.show>.btn-outline-danger.dropdown-toggle{color:#fff;background-color:#dc3545;border-color:#dc3545}.btn-outline-light.focus,.btn-outline-light:focus,.btn-outline-light:not(:disabled):not(.disabled).active:focus,.btn-outline-light:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-light.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(248,249,250,.5)}.btn-outline-light{color:#f8f9fa;background-color:transparent;border-color:#f8f9fa}.btn-outline-light:hover{color:#212529;background-color:#f8f9fa;border-color:#f8f9fa}.btn-outline-light.disabled,.btn-outline-light:disabled{color:#f8f9fa;background-color:transparent}.btn-outline-light:not(:disabled):not(.disabled).active,.btn-outline-light:not(:disabled):not(.disabled):active,.show>.btn-outline-light.dropdown-toggle{color:#212529;background-color:#f8f9fa;border-color:#f8f9fa}.btn-outline-dark.focus,.btn-outline-dark:focus,.btn-outline-dark:not(:disabled):not(.disabled).active:focus,.btn-outline-dark:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-dark.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(52,58,64,.5)}.btn-outline-dark{color:#343a40;background-color:transparent;border-color:#343a40}.btn-outline-dark:hover{color:#fff;background-color:#343a40;border-color:#343a40}.btn-outline-dark.disabled,.btn-outline-dark:disabled{color:#343a40;background-color:transparent}.btn-outline-dark:not(:disabled):not(.disabled).active,.btn-outline-dark:not(:disabled):not(.disabled):active,.show>.btn-outline-dark.dropdown-toggle{color:#fff;background-color:#343a40;border-color:#343a40}.btn-link,.btn-link:hover{background-color:transparent}.btn-link.focus,.btn-link:focus,.btn-link:hover{text-decoration:underline;border-color:transparent}.btn-link{color:#007bff}.btn-link:hover{color:#0056b3}.btn-link.focus,.btn-link:focus{box-shadow:none}.btn-link.disabled,.btn-link:disabled{color:#6c757d;pointer-events:none}.btn-group-lg>.btn,.btn-lg{padding:.5rem 1rem;font-size:1.25rem;line-height:1.5;border-radius:.3rem}.btn-group-sm>.btn,.btn-sm{padding:.25rem .5rem;font-size:.875rem;line-height:1.5;border-radius:.2rem}.btn-block{display:block}.btn-block+.btn-block{margin-top:.5rem}.dropdown-toggle::after,.dropup .dropdown-toggle::after{width:0;height:0;vertical-align:.255em;content:""}.fade{transition:opacity .15s linear}@media screen and (prefers-reduced-motion:reduce){.fade{transition:none}}.fade:not(.show){opacity:0}.collapse:not(.show){display:none}.collapsing{height:0;transition:height .35s ease}@media screen and (prefers-reduced-motion:reduce){.collapsing{transition:none}}.dropdown-toggle::after{display:inline-block;margin-left:.255em;border-top:.3em solid;border-right:.3em solid transparent;border-bottom:0;border-left:.3em solid transparent}.dropdown-toggle:empty::after{margin-left:0}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:10rem;padding:.5rem 0;margin:.125rem 0 0;font-size:1rem;color:#212529;text-align:left;background-color:#fff;border:1px solid rgba(0,0,0,.15);border-radius:.25rem}.dropdown-menu-right{right:0;left:auto}.dropup .dropdown-menu{top:auto;bottom:100%;margin-top:0;margin-bottom:.125rem}.dropup .dropdown-toggle::after{display:inline-block;margin-left:.255em;border-top:0;border-right:.3em solid transparent;border-bottom:.3em solid;border-left:.3em solid transparent}.dropleft .dropdown-toggle::before,.dropright .dropdown-toggle::after{width:0;content:"";border-top:.3em solid transparent;border-bottom:.3em solid transparent;height:0}.dropup .dropdown-toggle:empty::after{margin-left:0}.dropright .dropdown-menu{top:0;right:auto;left:100%;margin-top:0;margin-left:.125rem}.dropright .dropdown-toggle::after{display:inline-block;margin-left:.255em;border-right:0;border-left:.3em solid;vertical-align:0}.dropright .dropdown-toggle:empty::after{margin-left:0}.dropleft .dropdown-menu{top:0;right:100%;left:auto;margin-top:0;margin-right:.125rem}.dropleft .dropdown-toggle::after{width:0;height:0;margin-left:.255em;vertical-align:.255em;content:"";display:none}.dropleft .dropdown-toggle::before{display:inline-block;margin-right:.255em;border-right:.3em solid;vertical-align:0}.dropleft .dropdown-toggle:empty::after{margin-left:0}.dropdown-menu[x-placement^=top],.dropdown-menu[x-placement^=right],.dropdown-menu[x-placement^=bottom],.dropdown-menu[x-placement^=left]{right:auto;bottom:auto}.dropdown-divider{height:0;margin:.5rem 0;overflow:hidden;border-top:1px solid #e9ecef}.btn-group-toggle>.btn,.btn-group-toggle>.btn-group>.btn,.custom-control-label,.custom-file,.dropdown-header,.input-group-text,.nav{margin-bottom:0}.dropdown-item{display:block;width:100%;padding:.25rem 1.5rem;clear:both;color:#212529;text-align:inherit;background-color:transparent;border:0}.btn-group>.btn-group:not(:last-child)>.btn,.btn-group>.btn:not(:last-child):not(.dropdown-toggle),.input-group>.custom-file:not(:last-child) .custom-file-label,.input-group>.custom-file:not(:last-child) .custom-file-label::after,.input-group>.custom-select:not(:last-child),.input-group>.form-control:not(:last-child){border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn-group:not(:first-child)>.btn,.btn-group>.btn:not(:first-child),.input-group>.custom-file:not(:first-child) .custom-file-label,.input-group>.custom-select:not(:first-child),.input-group>.form-control:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.dropdown-item:focus,.dropdown-item:hover{color:#16181b;text-decoration:none;background-color:#f8f9fa}.dropdown-item.active,.dropdown-item:active{color:#fff;text-decoration:none;background-color:#007bff}.dropdown-item.disabled,.dropdown-item:disabled{color:#6c757d;background-color:transparent}.dropdown-menu.show{display:block}.dropdown-header{display:block;padding:.5rem 1.5rem;font-size:.875rem;color:#6c757d}.dropdown-item-text{display:block;padding:.25rem 1.5rem;color:#212529}.btn-group,.btn-group-vertical{position:relative;display:inline-flex;vertical-align:middle}.btn-group-vertical>.btn,.btn-group>.btn{position:relative;flex:0 1 auto}.btn-group-vertical>.btn.active,.btn-group-vertical>.btn:active,.btn-group-vertical>.btn:focus,.btn-group-vertical>.btn:hover,.btn-group>.btn.active,.btn-group>.btn:active,.btn-group>.btn:focus,.btn-group>.btn:hover{z-index:1}.btn-group .btn+.btn,.btn-group .btn+.btn-group,.btn-group .btn-group+.btn,.btn-group .btn-group+.btn-group,.btn-group-vertical .btn+.btn,.btn-group-vertical .btn+.btn-group,.btn-group-vertical .btn-group+.btn,.btn-group-vertical .btn-group+.btn-group{margin-left:-1px}.btn-group>.btn:first-child,.dropdown-toggle-split::after,.dropright .dropdown-toggle-split::after,.dropup .dropdown-toggle-split::after{margin-left:0}.btn-toolbar{display:flex;flex-wrap:wrap;justify-content:flex-start}.btn-toolbar .input-group{width:auto}.dropdown-toggle-split{padding-right:.5625rem;padding-left:.5625rem}.dropleft .dropdown-toggle-split::before{margin-right:0}.btn-group-sm>.btn+.dropdown-toggle-split,.btn-sm+.dropdown-toggle-split{padding-right:.375rem;padding-left:.375rem}.btn-group-lg>.btn+.dropdown-toggle-split,.btn-lg+.dropdown-toggle-split{padding-right:.75rem;padding-left:.75rem}.btn-group-vertical{flex-direction:column;align-items:flex-start;justify-content:center}.btn-group-vertical .btn,.btn-group-vertical .btn-group{width:100%}.btn-group-vertical>.btn+.btn,.btn-group-vertical>.btn+.btn-group,.btn-group-vertical>.btn-group+.btn,.btn-group-vertical>.btn-group+.btn-group{margin-top:-1px;margin-left:0}.input-group-append,.input-group-append .btn+.btn,.input-group-append .btn+.input-group-text,.input-group-append .input-group-text+.btn,.input-group-append .input-group-text+.input-group-text,.input-group-prepend .btn+.btn,.input-group-prepend .btn+.input-group-text,.input-group-prepend .input-group-text+.btn,.input-group-prepend .input-group-text+.input-group-text,.input-group>.custom-file+.custom-file,.input-group>.custom-file+.custom-select,.input-group>.custom-file+.form-control,.input-group>.custom-select+.custom-file,.input-group>.custom-select+.custom-select,.input-group>.custom-select+.form-control,.input-group>.form-control+.custom-file,.input-group>.form-control+.custom-select,.input-group>.form-control+.form-control{margin-left:-1px}.btn-group-vertical>.btn-group:not(:last-child)>.btn,.btn-group-vertical>.btn:not(:last-child):not(.dropdown-toggle){border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn-group:not(:first-child)>.btn,.btn-group-vertical>.btn:not(:first-child){border-top-left-radius:0;border-top-right-radius:0}.btn-group-toggle>.btn input[type=radio],.btn-group-toggle>.btn input[type=checkbox],.btn-group-toggle>.btn-group>.btn input[type=radio],.btn-group-toggle>.btn-group>.btn input[type=checkbox]{position:absolute;clip:rect(0,0,0,0);pointer-events:none}.input-group{position:relative;display:flex;flex-wrap:wrap;align-items:stretch;width:100%}.input-group>.custom-file,.input-group>.custom-select,.input-group>.form-control{position:relative;flex:1 1 auto;width:1%;margin-bottom:0}.input-group>.custom-file .custom-file-input:focus~.custom-file-label,.input-group>.custom-select:focus,.input-group>.form-control:focus{z-index:3}.input-group>.custom-file{display:flex;align-items:center}.input-group-append,.input-group-prepend{display:flex}.input-group-append .btn,.input-group-prepend .btn{position:relative;z-index:2}.input-group-prepend{margin-right:-1px}.input-group-text{display:flex;align-items:center;padding:.375rem .75rem;font-size:1rem;font-weight:400;line-height:1.5;color:#495057;text-align:center;background-color:#e9ecef;border:1px solid #ced4da;border-radius:.25rem}.nav,.navbar{flex-wrap:wrap}.input-group-text input[type=radio],.input-group-text input[type=checkbox]{margin-top:0}.input-group>.input-group-append:last-child>.btn:not(:last-child):not(.dropdown-toggle),.input-group>.input-group-append:last-child>.input-group-text:not(:last-child),.input-group>.input-group-append:not(:last-child)>.btn,.input-group>.input-group-append:not(:last-child)>.input-group-text,.input-group>.input-group-prepend>.btn,.input-group>.input-group-prepend>.input-group-text{border-top-right-radius:0;border-bottom-right-radius:0}.input-group>.input-group-append>.btn,.input-group>.input-group-append>.input-group-text,.input-group>.input-group-prepend:first-child>.btn:not(:first-child),.input-group>.input-group-prepend:first-child>.input-group-text:not(:first-child),.input-group>.input-group-prepend:not(:first-child)>.btn,.input-group>.input-group-prepend:not(:first-child)>.input-group-text{border-top-left-radius:0;border-bottom-left-radius:0}.custom-control{position:relative;display:block;min-height:1.5rem;padding-left:1.5rem}.custom-control-inline{display:inline-flex;margin-right:1rem}.custom-control-input{position:absolute;z-index:-1;opacity:0}.custom-control-input:checked~.custom-control-label::before{color:#fff;background-color:#007bff}.custom-control-input:focus~.custom-control-label::before{box-shadow:0 0 0 1px #fff,0 0 0 .2rem rgba(0,123,255,.25)}.custom-control-input:active~.custom-control-label::before{color:#fff;background-color:#b3d7ff}.custom-control-input:disabled~.custom-control-label{color:#6c757d}.custom-control-input:disabled~.custom-control-label::before{background-color:#e9ecef}.custom-control-label{position:relative}.custom-control-label::after,.custom-control-label::before{position:absolute;top:.25rem;left:-1.5rem;display:block;width:1rem;height:1rem;content:""}.custom-control-label::before{pointer-events:none;user-select:none;background-color:#dee2e6}.custom-checkbox .custom-control-input:checked~.custom-control-label::before,.custom-checkbox .custom-control-input:indeterminate~.custom-control-label::before{background-color:#007bff}.custom-control-label::after{background-repeat:no-repeat;background-position:center center;background-size:50% 50%}.custom-file-input:lang(en)~.custom-file-label::after,.custom-file-label::after{content:"Browse"}.custom-checkbox .custom-control-label::before{border-radius:.25rem}.custom-checkbox .custom-control-input:checked~.custom-control-label::after{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath fill='%23fff' d='M6.564.75l-3.59 3.612-1.538-1.55L0 4.26 2.974 7.25 8 2.193z'/%3E%3C/svg%3E")}.custom-checkbox .custom-control-input:indeterminate~.custom-control-label::after{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 4'%3E%3Cpath stroke='%23fff' d='M0 2h4'/%3E%3C/svg%3E")}.custom-checkbox .custom-control-input:disabled:checked~.custom-control-label::before,.custom-checkbox .custom-control-input:disabled:indeterminate~.custom-control-label::before{background-color:rgba(0,123,255,.5)}.custom-radio .custom-control-label::before{border-radius:50%}.custom-radio .custom-control-input:checked~.custom-control-label::before{background-color:#007bff}.custom-radio .custom-control-input:checked~.custom-control-label::after{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3E%3Ccircle r='3' fill='%23fff'/%3E%3C/svg%3E")}.custom-radio .custom-control-input:disabled:checked~.custom-control-label::before{background-color:rgba(0,123,255,.5)}.custom-select{display:inline-block;width:100%;height:calc(2.25rem + 2px);padding:.375rem 1.75rem .375rem .75rem;line-height:1.5;color:#495057;vertical-align:middle;background:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'%3E%3Cpath fill='%23343a40' d='M2 0L0 2h4zm0 5L0 3h4z'/%3E%3C/svg%3E") right .75rem center no-repeat #fff;background-size:8px 10px;border:1px solid #ced4da;border-radius:.25rem;appearance:none}.custom-select-lg,.custom-select-sm{padding-top:.375rem;padding-bottom:.375rem}.custom-file-input:focus~.custom-file-label::after,.custom-select:focus{border-color:#80bdff}.custom-select:focus{outline:0;box-shadow:0 0 0 .2rem rgba(128,189,255,.5)}.custom-select:focus::-ms-value{color:#495057;background-color:#fff}.custom-file-input:disabled~.custom-file-label,.custom-select:disabled{background-color:#e9ecef}.custom-select[multiple],.custom-select[size]:not([size="1"]){height:auto;padding-right:.75rem;background-image:none}.custom-select:disabled{color:#6c757d}.custom-select::-ms-expand{opacity:0}.custom-select-sm{height:calc(1.8125rem + 2px);font-size:75%}.custom-select-lg{height:calc(2.875rem + 2px);font-size:125%}.custom-file,.custom-file-input,.custom-file-label{height:calc(2.25rem + 2px)}.custom-file{position:relative;display:inline-block;width:100%}.custom-file-input{position:relative;z-index:2;width:100%;margin:0;opacity:0}.custom-file-label,.custom-file-label::after{position:absolute;padding:.375rem .75rem;line-height:1.5;color:#495057;top:0;right:0}.custom-file-input:focus~.custom-file-label{border-color:#80bdff;box-shadow:0 0 0 .2rem rgba(0,123,255,.25)}.custom-file-label{left:0;z-index:1;background-color:#fff;border:1px solid #ced4da;border-radius:.25rem}.custom-file-label::after{bottom:0;z-index:3;display:block;height:2.25rem;background-color:#e9ecef;border-left:1px solid #ced4da;border-radius:0 .25rem .25rem 0}.custom-range{width:100%;padding-left:0;background-color:transparent;appearance:none}.custom-range:focus{outline:0}.custom-range::-moz-focus-outer{border:0}.custom-range::-webkit-slider-thumb{width:1rem;height:1rem;margin-top:-.25rem;background-color:#007bff;border:0;border-radius:1rem;transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;appearance:none}@media screen and (prefers-reduced-motion:reduce){.custom-range::-webkit-slider-thumb{transition:none}}.custom-range::-webkit-slider-thumb:focus{outline:0;box-shadow:0 0 0 1px #fff,0 0 0 .2rem rgba(0,123,255,.25)}.custom-range::-webkit-slider-thumb:active{background-color:#b3d7ff}.custom-range::-webkit-slider-runnable-track{width:100%;height:.5rem;color:transparent;cursor:pointer;background-color:#dee2e6;border-color:transparent;border-radius:1rem}.custom-range::-moz-range-thumb{width:1rem;height:1rem;background-color:#007bff;border:0;border-radius:1rem;transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;appearance:none}@media screen and (prefers-reduced-motion:reduce){.custom-range::-moz-range-thumb{transition:none}}.custom-range::-moz-range-thumb:focus{outline:0;box-shadow:0 0 0 1px #fff,0 0 0 .2rem rgba(0,123,255,.25)}.custom-range::-moz-range-thumb:active{background-color:#b3d7ff}.custom-range::-moz-range-track{width:100%;height:.5rem;color:transparent;cursor:pointer;background-color:#dee2e6;border-color:transparent;border-radius:1rem}.custom-range::-ms-thumb{width:1rem;height:1rem;background-color:#007bff;border:0;border-radius:1rem;transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;appearance:none}@media screen and (prefers-reduced-motion:reduce){.custom-range::-ms-thumb{transition:none}}.custom-range::-ms-thumb:focus{outline:0;box-shadow:0 0 0 1px #fff,0 0 0 .2rem rgba(0,123,255,.25)}.custom-range::-ms-thumb:active{background-color:#b3d7ff}.custom-range::-ms-track{width:100%;height:.5rem;color:transparent;cursor:pointer;background-color:transparent;border-color:transparent;border-width:.5rem}.custom-range::-ms-fill-lower{background-color:#dee2e6;border-radius:1rem}.custom-range::-ms-fill-upper{margin-right:15px;background-color:#dee2e6;border-radius:1rem}.custom-control-label::before,.custom-file-label,.custom-select{transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out}@media screen and (prefers-reduced-motion:reduce){.custom-control-label::before,.custom-file-label,.custom-select{transition:none}}.nav{display:flex;padding-left:0}.nav-link,.navbar{padding:.5rem 1rem}.nav-link{display:block}.nav-link:focus,.nav-link:hover{text-decoration:none}.nav-link.disabled{color:#6c757d}.nav-tabs{border-bottom:1px solid #dee2e6}.nav-tabs .nav-item{margin-bottom:-1px}.nav-tabs .nav-link{border:1px solid transparent;border-top-left-radius:.25rem;border-top-right-radius:.25rem}.nav-tabs .nav-link:focus,.nav-tabs .nav-link:hover{border-color:#e9ecef #e9ecef #dee2e6}.nav-tabs .nav-link.disabled{color:#6c757d;background-color:transparent;border-color:transparent}.nav-tabs .nav-item.show .nav-link,.nav-tabs .nav-link.active{color:#495057;background-color:#fff;border-color:#dee2e6 #dee2e6 #fff}.nav-tabs .dropdown-menu{margin-top:-1px;border-top-left-radius:0;border-top-right-radius:0}.nav-pills .nav-link{border-radius:.25rem}.nav-pills .nav-link.active,.nav-pills .show>.nav-link{color:#fff;background-color:#007bff}.nav-fill .nav-item{flex:1 1 auto;text-align:center}.nav-justified .nav-item{flex-basis:0;flex-grow:1;text-align:center}.tab-content>.tab-pane{display:none}.tab-content>.active{display:block}.navbar{position:relative;display:flex;align-items:center;justify-content:space-between}.navbar>.container,.navbar>.container-fluid{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between}.navbar-brand{display:inline-block;padding-top:.3125rem;padding-bottom:.3125rem;margin-right:1rem;font-size:1.25rem;line-height:inherit}.navbar-brand:focus,.navbar-brand:hover{text-decoration:none}.navbar-nav{display:flex;flex-direction:column;padding-left:0;margin-bottom:0}.navbar-nav .nav-link{padding-right:0;padding-left:0}.navbar-nav .dropdown-menu{position:static;float:none}.navbar-text{display:inline-block;padding-top:.5rem;padding-bottom:.5rem}.navbar-collapse{flex-basis:100%;flex-grow:1;align-items:center}.navbar-toggler{padding:.25rem .75rem;font-size:1.25rem;line-height:1;background-color:transparent;border:1px solid transparent;border-radius:.25rem}.navbar-toggler:focus,.navbar-toggler:hover{text-decoration:none}.navbar-toggler-icon{display:inline-block;width:1.5em;height:1.5em;vertical-align:middle;content:"";background:center center no-repeat;background-size:100% 100%}@media (max-width:575.98px){.navbar-expand-sm>.container,.navbar-expand-sm>.container-fluid{padding-right:0;padding-left:0}}@media (min-width:576px){.navbar-expand-sm{flex-flow:row nowrap;justify-content:flex-start}.navbar-expand-sm .navbar-nav{flex-direction:row}.navbar-expand-sm .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-sm .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand-sm>.container,.navbar-expand-sm>.container-fluid{flex-wrap:nowrap}.navbar-expand-sm .navbar-collapse{display:flex!important;flex-basis:auto}.navbar-expand-sm .navbar-toggler{display:none}}@media (max-width:767.98px){.navbar-expand-md>.container,.navbar-expand-md>.container-fluid{padding-right:0;padding-left:0}}@media (min-width:768px){.navbar-expand-md{flex-flow:row nowrap;justify-content:flex-start}.navbar-expand-md .navbar-nav{flex-direction:row}.navbar-expand-md .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-md .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand-md>.container,.navbar-expand-md>.container-fluid{flex-wrap:nowrap}.navbar-expand-md .navbar-collapse{display:flex!important;flex-basis:auto}.navbar-expand-md .navbar-toggler{display:none}}@media (max-width:991.98px){.navbar-expand-lg>.container,.navbar-expand-lg>.container-fluid{padding-right:0;padding-left:0}}@media (min-width:992px){.navbar-expand-lg{flex-flow:row nowrap;justify-content:flex-start}.navbar-expand-lg .navbar-nav{flex-direction:row}.navbar-expand-lg .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-lg .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand-lg>.container,.navbar-expand-lg>.container-fluid{flex-wrap:nowrap}.navbar-expand-lg .navbar-collapse{display:flex!important;flex-basis:auto}.navbar-expand-lg .navbar-toggler{display:none}}@media (max-width:1199.98px){.navbar-expand-xl>.container,.navbar-expand-xl>.container-fluid{padding-right:0;padding-left:0}}@media (min-width:1200px){.navbar-expand-xl{flex-flow:row nowrap;justify-content:flex-start}.navbar-expand-xl .navbar-nav{flex-direction:row}.navbar-expand-xl .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-xl .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand-xl>.container,.navbar-expand-xl>.container-fluid{flex-wrap:nowrap}.navbar-expand-xl .navbar-collapse{display:flex!important;flex-basis:auto}.navbar-expand-xl .navbar-toggler{display:none}}.navbar-expand{flex-flow:row nowrap;justify-content:flex-start}.navbar-expand>.container,.navbar-expand>.container-fluid{padding-right:0;padding-left:0}.navbar-expand .navbar-nav{flex-direction:row}.navbar-expand .navbar-nav .dropdown-menu{position:absolute}.navbar-expand .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand>.container,.navbar-expand>.container-fluid{flex-wrap:nowrap}.navbar-expand .navbar-collapse{display:flex!important;flex-basis:auto}.navbar-expand .navbar-toggler{display:none}.navbar-light .navbar-brand,.navbar-light .navbar-brand:focus,.navbar-light .navbar-brand:hover{color:rgba(0,0,0,.9)}.navbar-light .navbar-nav .nav-link{color:rgba(0,0,0,.5)}.navbar-light .navbar-nav .nav-link:focus,.navbar-light .navbar-nav .nav-link:hover{color:rgba(0,0,0,.7)}.navbar-light .navbar-nav .nav-link.disabled{color:rgba(0,0,0,.3)}.navbar-light .navbar-nav .active>.nav-link,.navbar-light .navbar-nav .nav-link.active,.navbar-light .navbar-nav .nav-link.show,.navbar-light .navbar-nav .show>.nav-link{color:rgba(0,0,0,.9)}.navbar-light .navbar-toggler{color:rgba(0,0,0,.5);border-color:rgba(0,0,0,.1)}.navbar-light .navbar-toggler-icon{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(0, 0, 0, 0.5)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E")}.navbar-light .navbar-text{color:rgba(0,0,0,.5)}.navbar-light .navbar-text a,.navbar-light .navbar-text a:focus,.navbar-light .navbar-text a:hover{color:rgba(0,0,0,.9)}.navbar-dark .navbar-brand,.navbar-dark .navbar-brand:focus,.navbar-dark .navbar-brand:hover{color:#fff}.navbar-dark .navbar-nav .nav-link{color:rgba(255,255,255,.5)}.navbar-dark .navbar-nav .nav-link:focus,.navbar-dark .navbar-nav .nav-link:hover{color:rgba(255,255,255,.75)}.navbar-dark .navbar-nav .nav-link.disabled{color:rgba(255,255,255,.25)}.navbar-dark .navbar-nav .active>.nav-link,.navbar-dark .navbar-nav .nav-link.active,.navbar-dark .navbar-nav .nav-link.show,.navbar-dark .navbar-nav .show>.nav-link{color:#fff}.navbar-dark .navbar-toggler{color:rgba(255,255,255,.5);border-color:rgba(255,255,255,.1)}.navbar-dark .navbar-toggler-icon{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(255, 255, 255, 0.5)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E")}.navbar-dark .navbar-text{color:rgba(255,255,255,.5)}.navbar-dark .navbar-text a,.navbar-dark .navbar-text a:focus,.navbar-dark .navbar-text a:hover{color:#fff}.card{position:relative;display:flex;flex-direction:column;min-width:0;word-wrap:break-word;background-color:#fff;background-clip:border-box;border:1px solid rgba(0,0,0,.125);border-radius:.25rem}.card>hr{margin-right:0;margin-left:0}.card>.list-group:first-child .list-group-item:first-child{border-top-left-radius:.25rem;border-top-right-radius:.25rem}.card>.list-group:last-child .list-group-item:last-child{border-bottom-right-radius:.25rem;border-bottom-left-radius:.25rem}.card-body{flex:1 1 auto;padding:1.25rem}.card-footer,.card-header{padding:.75rem 1.25rem;background-color:rgba(0,0,0,.03)}.card-title{margin-bottom:.75rem}.card-header,.card-subtitle,.card-text:last-child{margin-bottom:0}.card-subtitle{margin-top:-.375rem}.card-link:hover{text-decoration:none}.card-link+.card-link{margin-left:1.25rem}.card-header-pills,.card-header-tabs{margin-right:-.625rem;margin-left:-.625rem}.card-header{border-bottom:1px solid rgba(0,0,0,.125)}.card-header:first-child{border-radius:calc(.25rem - 1px) calc(.25rem - 1px) 0 0}.card-header+.list-group .list-group-item:first-child{border-top:0}.card-footer{border-top:1px solid rgba(0,0,0,.125)}.card-footer:last-child{border-radius:0 0 calc(.25rem - 1px) calc(.25rem - 1px)}.card-header-tabs{margin-bottom:-.75rem;border-bottom:0}.card-img-overlay{position:absolute;top:0;right:0;bottom:0;left:0;padding:1.25rem}.alert,.btn .badge,.page-link{position:relative}.card-img{width:100%;border-radius:calc(.25rem - 1px)}.card-img-top{width:100%;border-top-left-radius:calc(.25rem - 1px);border-top-right-radius:calc(.25rem - 1px)}.card-img-bottom{width:100%;border-bottom-right-radius:calc(.25rem - 1px);border-bottom-left-radius:calc(.25rem - 1px)}.card-deck{display:flex;flex-direction:column}.card-deck .card{margin-bottom:15px}@media (min-width:576px){.card-deck{flex-flow:row wrap;margin-right:-15px;margin-left:-15px}.card-deck .card{display:flex;flex:1 0 0%;flex-direction:column;margin-right:15px;margin-bottom:0;margin-left:15px}}.card-group{display:flex;flex-direction:column}.card-group>.card{margin-bottom:15px}@media (min-width:576px){.card-group{flex-flow:row wrap}.card-group>.card{flex:1 0 0%;margin-bottom:0}.card-group>.card+.card{margin-left:0;border-left:0}.card-group>.card:first-child{border-top-right-radius:0;border-bottom-right-radius:0}.card-group>.card:first-child .card-header,.card-group>.card:first-child .card-img-top{border-top-right-radius:0}.card-group>.card:first-child .card-footer,.card-group>.card:first-child .card-img-bottom{border-bottom-right-radius:0}.card-group>.card:last-child{border-top-left-radius:0;border-bottom-left-radius:0}.card-group>.card:last-child .card-header,.card-group>.card:last-child .card-img-top{border-top-left-radius:0}.card-group>.card:last-child .card-footer,.card-group>.card:last-child .card-img-bottom{border-bottom-left-radius:0}.card-group>.card:only-child{border-radius:.25rem}.card-group>.card:only-child .card-header,.card-group>.card:only-child .card-img-top{border-top-left-radius:.25rem;border-top-right-radius:.25rem}.card-group>.card:only-child .card-footer,.card-group>.card:only-child .card-img-bottom{border-bottom-right-radius:.25rem;border-bottom-left-radius:.25rem}.card-group>.card:not(:first-child):not(:last-child):not(:only-child),.card-group>.card:not(:first-child):not(:last-child):not(:only-child) .card-footer,.card-group>.card:not(:first-child):not(:last-child):not(:only-child) .card-header,.card-group>.card:not(:first-child):not(:last-child):not(:only-child) .card-img-bottom,.card-group>.card:not(:first-child):not(:last-child):not(:only-child) .card-img-top{border-radius:0}.card-columns{column-count:3;column-gap:1.25rem;orphans:1;widows:1}.card-columns .card{display:inline-block;width:100%}}.card-columns .card{margin-bottom:.75rem}.accordion .card:not(:first-of-type):not(:last-of-type){border-bottom:0;border-radius:0}.accordion .card:not(:first-of-type) .card-header:first-child{border-radius:0}.accordion .card:first-of-type{border-bottom:0;border-bottom-right-radius:0;border-bottom-left-radius:0}.accordion .card:last-of-type{border-top-left-radius:0;border-top-right-radius:0}.breadcrumb,.pagination{border-radius:.25rem;list-style:none}.breadcrumb{display:flex;flex-wrap:wrap;padding:.75rem 1rem;margin-bottom:1rem;background-color:#e9ecef}.breadcrumb-item+.breadcrumb-item{padding-left:.5rem}.breadcrumb-item+.breadcrumb-item::before{display:inline-block;padding-right:.5rem;color:#6c757d;content:"/"}.breadcrumb-item+.breadcrumb-item:hover::before{text-decoration:none}.breadcrumb-item.active{color:#6c757d}.pagination{display:flex;padding-left:0}.page-link{display:block;padding:.5rem .75rem;margin-left:-1px;line-height:1.25;color:#007bff;background-color:#fff;border:1px solid #dee2e6}.page-link:hover{z-index:2;color:#0056b3;text-decoration:none;background-color:#e9ecef;border-color:#dee2e6}.page-link:focus{z-index:2;outline:0;box-shadow:0 0 0 .2rem rgba(0,123,255,.25)}.page-item:first-child .page-link{margin-left:0;border-top-left-radius:.25rem;border-bottom-left-radius:.25rem}.page-item:last-child .page-link{border-top-right-radius:.25rem;border-bottom-right-radius:.25rem}.page-item.active .page-link{z-index:1;color:#fff;background-color:#007bff;border-color:#007bff}.page-item.disabled .page-link{color:#6c757d;pointer-events:none;cursor:auto;background-color:#fff;border-color:#dee2e6}.carousel-indicators li,.close:not(:disabled):not(.disabled),.ember-radio-button,.identifier,td.line-number{cursor:pointer}.pagination-lg .page-link{padding:.75rem 1.5rem;font-size:1.25rem;line-height:1.5}.pagination-lg .page-item:first-child .page-link{border-top-left-radius:.3rem;border-bottom-left-radius:.3rem}.pagination-lg .page-item:last-child .page-link{border-top-right-radius:.3rem;border-bottom-right-radius:.3rem}.pagination-sm .page-link{padding:.25rem .5rem;font-size:.875rem;line-height:1.5}.badge,.close{font-weight:700;line-height:1}.pagination-sm .page-item:first-child .page-link{border-top-left-radius:.2rem;border-bottom-left-radius:.2rem}.pagination-sm .page-item:last-child .page-link{border-top-right-radius:.2rem;border-bottom-right-radius:.2rem}.badge{display:inline-block;padding:.25em .4em;font-size:75%;text-align:center;border-radius:.25rem}.badge:empty{display:none}.btn .badge{top:-1px}.badge-pill{padding-right:.6em;padding-left:.6em;border-radius:10rem}.badge-primary{color:#fff;background-color:#007bff}.badge-primary[href]:focus,.badge-primary[href]:hover{color:#fff;text-decoration:none;background-color:#0062cc}.badge-secondary{color:#fff;background-color:#6c757d}.badge-secondary[href]:focus,.badge-secondary[href]:hover{color:#fff;text-decoration:none;background-color:#545b62}.badge-success{color:#fff;background-color:#28a745}.badge-success[href]:focus,.badge-success[href]:hover{color:#fff;text-decoration:none;background-color:#1e7e34}.badge-info{color:#fff;background-color:#17a2b8}.badge-info[href]:focus,.badge-info[href]:hover{color:#fff;text-decoration:none;background-color:#117a8b}.badge-warning{color:#212529;background-color:#ffc107}.badge-warning[href]:focus,.badge-warning[href]:hover{color:#212529;text-decoration:none;background-color:#d39e00}.badge-danger{color:#fff;background-color:#dc3545}.badge-danger[href]:focus,.badge-danger[href]:hover{color:#fff;text-decoration:none;background-color:#bd2130}.badge-light{color:#212529;background-color:#f8f9fa}.badge-light[href]:focus,.badge-light[href]:hover{color:#212529;text-decoration:none;background-color:#dae0e5}.badge-dark{color:#fff;background-color:#343a40}.badge-dark[href]:focus,.badge-dark[href]:hover{color:#fff;text-decoration:none;background-color:#1d2124}.jumbotron{padding:2rem 1rem;margin-bottom:2rem;background-color:#e9ecef;border-radius:.3rem}@media (min-width:576px){.jumbotron{padding:4rem 2rem}}.jumbotron-fluid{padding-right:0;padding-left:0;border-radius:0}.alert{padding:.75rem 1.25rem;margin-bottom:1rem;border:1px solid transparent;border-radius:.25rem}.alert-heading{color:inherit}.alert-link{font-weight:700}.alert-dismissible{padding-right:4rem}.alert-dismissible .close{position:absolute;top:0;right:0;padding:.75rem 1.25rem;color:inherit}.alert-primary{color:#004085;background-color:#cce5ff;border-color:#b8daff}.alert-primary hr{border-top-color:#9fcdff}.alert-primary .alert-link{color:#002752}.alert-secondary{color:#383d41;background-color:#e2e3e5;border-color:#d6d8db}.alert-secondary hr{border-top-color:#c8cbcf}.alert-secondary .alert-link{color:#202326}.alert-success{color:#155724;background-color:#d4edda;border-color:#c3e6cb}.alert-success hr{border-top-color:#b1dfbb}.alert-success .alert-link{color:#0b2e13}.alert-info{color:#0c5460;background-color:#d1ecf1;border-color:#bee5eb}.alert-info hr{border-top-color:#abdde5}.alert-info .alert-link{color:#062c33}.alert-warning{color:#856404;background-color:#fff3cd;border-color:#ffeeba}.alert-warning hr{border-top-color:#ffe8a1}.alert-warning .alert-link{color:#533f03}.alert-danger{color:#721c24;background-color:#f8d7da;border-color:#f5c6cb}.alert-danger hr{border-top-color:#f1b0b7}.alert-danger .alert-link{color:#491217}.alert-light{color:#818182;background-color:#fefefe;border-color:#fdfdfe}.alert-light hr{border-top-color:#ececf6}.alert-light .alert-link{color:#686868}.alert-dark{color:#1b1e21;background-color:#d6d8d9;border-color:#c6c8ca}.alert-dark hr{border-top-color:#b9bbbe}.alert-dark .alert-link{color:#040505}@keyframes progress-bar-stripes{from{background-position:1rem 0}to{background-position:0 0}}.progress{display:flex;height:1rem;font-size:.75rem;background-color:#e9ecef;border-radius:.25rem}.progress-bar{display:flex;flex-direction:column;justify-content:center;color:#fff;text-align:center;background-color:#007bff;transition:width .6s ease}@media screen and (prefers-reduced-motion:reduce){.progress-bar{transition:none}}.progress-bar-striped{background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-size:1rem 1rem}.progress-bar-animated{animation:progress-bar-stripes 1s linear infinite}.media{display:flex;align-items:flex-start}.media-body{flex:1}.list-group{display:flex;flex-direction:column;padding-left:0;margin-bottom:0}.list-group-item-action{width:100%;color:#495057;text-align:inherit}.list-group-item-action:focus,.list-group-item-action:hover{color:#495057;text-decoration:none;background-color:#f8f9fa}.list-group-item-action:active{color:#212529;background-color:#e9ecef}.list-group-item{position:relative;display:block;padding:.75rem 1.25rem;margin-bottom:-1px;background-color:#fff;border:1px solid rgba(0,0,0,.125)}.list-group-item:first-child{border-top-left-radius:.25rem;border-top-right-radius:.25rem}.list-group-item:last-child{margin-bottom:0;border-bottom-right-radius:.25rem;border-bottom-left-radius:.25rem}.list-group-item:focus,.list-group-item:hover{z-index:1;text-decoration:none}.list-group-item.disabled,.list-group-item:disabled{color:#6c757d;background-color:#fff}.list-group-item.active{z-index:2;color:#fff;background-color:#007bff;border-color:#007bff}.list-group-flush .list-group-item{border-right:0;border-left:0;border-radius:0}.list-group-flush:first-child .list-group-item:first-child{border-top:0}.list-group-flush:last-child .list-group-item:last-child{border-bottom:0}.list-group-item-primary{color:#004085;background-color:#b8daff}.list-group-item-primary.list-group-item-action:focus,.list-group-item-primary.list-group-item-action:hover{color:#004085;background-color:#9fcdff}.list-group-item-primary.list-group-item-action.active{color:#fff;background-color:#004085;border-color:#004085}.list-group-item-secondary{color:#383d41;background-color:#d6d8db}.list-group-item-secondary.list-group-item-action:focus,.list-group-item-secondary.list-group-item-action:hover{color:#383d41;background-color:#c8cbcf}.list-group-item-secondary.list-group-item-action.active{color:#fff;background-color:#383d41;border-color:#383d41}.list-group-item-success{color:#155724;background-color:#c3e6cb}.list-group-item-success.list-group-item-action:focus,.list-group-item-success.list-group-item-action:hover{color:#155724;background-color:#b1dfbb}.list-group-item-success.list-group-item-action.active{color:#fff;background-color:#155724;border-color:#155724}.list-group-item-info{color:#0c5460;background-color:#bee5eb}.list-group-item-info.list-group-item-action:focus,.list-group-item-info.list-group-item-action:hover{color:#0c5460;background-color:#abdde5}.list-group-item-info.list-group-item-action.active{color:#fff;background-color:#0c5460;border-color:#0c5460}.list-group-item-warning{color:#856404;background-color:#ffeeba}.list-group-item-warning.list-group-item-action:focus,.list-group-item-warning.list-group-item-action:hover{color:#856404;background-color:#ffe8a1}.list-group-item-warning.list-group-item-action.active{color:#fff;background-color:#856404;border-color:#856404}.list-group-item-danger{color:#721c24;background-color:#f5c6cb}.list-group-item-danger.list-group-item-action:focus,.list-group-item-danger.list-group-item-action:hover{color:#721c24;background-color:#f1b0b7}.list-group-item-danger.list-group-item-action.active{color:#fff;background-color:#721c24;border-color:#721c24}.list-group-item-light{color:#818182;background-color:#fdfdfe}.list-group-item-light.list-group-item-action:focus,.list-group-item-light.list-group-item-action:hover{color:#818182;background-color:#ececf6}.list-group-item-light.list-group-item-action.active{color:#fff;background-color:#818182;border-color:#818182}.list-group-item-dark{color:#1b1e21;background-color:#c6c8ca}.list-group-item-dark.list-group-item-action:focus,.list-group-item-dark.list-group-item-action:hover{color:#1b1e21;background-color:#b9bbbe}.list-group-item-dark.list-group-item-action.active{color:#fff;background-color:#1b1e21;border-color:#1b1e21}.close{float:right;font-size:1.5rem;color:#000;text-shadow:0 1px 0 #fff;opacity:.5}.popover,.tooltip{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-style:normal;font-weight:400;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;white-space:normal;line-break:auto;font-size:.875rem;text-decoration:none;word-wrap:break-word}.modal-title,.popover,.tooltip{line-height:1.5}.popover,.text-hide,.tooltip{text-shadow:none}.close:not(:disabled):not(.disabled):focus,.close:not(:disabled):not(.disabled):hover{color:#000;text-decoration:none;opacity:.75}button.close{padding:0;background-color:transparent;border:0;-webkit-appearance:none}.modal{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1050;display:none;outline:0}.modal-open .modal{overflow-x:hidden;overflow-y:auto}.modal-dialog{position:relative;width:auto;margin:.5rem;pointer-events:none}.modal.fade .modal-dialog{transition:transform .3s ease-out;transform:translate(0,-25%)}@media screen and (prefers-reduced-motion:reduce){.modal.fade .modal-dialog{transition:none}}.modal.show .modal-dialog{transform:translate(0,0)}.modal-dialog-centered{display:flex;align-items:center;min-height:calc(100% - (.5rem * 2))}.modal-content{position:relative;display:flex;flex-direction:column;width:100%;pointer-events:auto;background-color:#fff;border:1px solid rgba(0,0,0,.2);border-radius:.3rem;outline:0}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;background-color:#000}.modal-backdrop.fade{opacity:0}.modal-backdrop.show{opacity:.5}.modal-header{display:flex;align-items:flex-start;justify-content:space-between;padding:1rem;border-bottom:1px solid #e9ecef;border-top-left-radius:.3rem;border-top-right-radius:.3rem}.modal-header .close{padding:1rem;margin:-1rem -1rem -1rem auto}.modal-title{margin-bottom:0}.modal-body{position:relative;flex:1 1 auto;padding:1rem}.modal-footer{display:flex;align-items:center;justify-content:flex-end;padding:1rem;border-top:1px solid #e9ecef}.popover,.popover .arrow,.popover .arrow::after,.popover .arrow::before,.tooltip,.tooltip .arrow{position:absolute;display:block}.modal-footer>:not(:first-child){margin-left:.25rem}.modal-footer>:not(:last-child){margin-right:.25rem}.modal-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}@media (min-width:576px){.modal-dialog{max-width:500px;margin:1.75rem auto}.modal-dialog-centered{min-height:calc(100% - (1.75rem * 2))}.modal-sm{max-width:300px}}@media (min-width:992px){.modal-lg{max-width:800px}}.tooltip{z-index:1070;margin:0;text-align:left;text-align:start;opacity:0}.tooltip.show{opacity:.9}.tooltip .arrow{width:.8rem;height:.4rem}.tooltip .arrow::before{position:absolute;content:"";border-color:transparent;border-style:solid}.bs-tooltip-auto[x-placement^=top],.bs-tooltip-top{padding:.4rem 0}.bs-tooltip-auto[x-placement^=top] .arrow,.bs-tooltip-top .arrow{bottom:0}.bs-tooltip-auto[x-placement^=top] .arrow::before,.bs-tooltip-top .arrow::before{top:0;border-width:.4rem .4rem 0;border-top-color:#000}.bs-tooltip-auto[x-placement^=right],.bs-tooltip-right{padding:0 .4rem}.bs-tooltip-auto[x-placement^=right] .arrow,.bs-tooltip-right .arrow{left:0;width:.4rem;height:.8rem}.bs-tooltip-auto[x-placement^=right] .arrow::before,.bs-tooltip-right .arrow::before{right:0;border-width:.4rem .4rem .4rem 0;border-right-color:#000}.bs-tooltip-auto[x-placement^=bottom],.bs-tooltip-bottom{padding:.4rem 0}.bs-tooltip-auto[x-placement^=bottom] .arrow,.bs-tooltip-bottom .arrow{top:0}.bs-tooltip-auto[x-placement^=bottom] .arrow::before,.bs-tooltip-bottom .arrow::before{bottom:0;border-width:0 .4rem .4rem;border-bottom-color:#000}.bs-tooltip-auto[x-placement^=left],.bs-tooltip-left{padding:0 .4rem}.bs-tooltip-auto[x-placement^=left] .arrow,.bs-tooltip-left .arrow{right:0;width:.4rem;height:.8rem}.bs-tooltip-auto[x-placement^=left] .arrow::before,.bs-tooltip-left .arrow::before{left:0;border-width:.4rem 0 .4rem .4rem;border-left-color:#000}.tooltip-inner{max-width:200px;padding:.25rem .5rem;color:#fff;text-align:center;background-color:#000;border-radius:.25rem}.popover{top:0;left:0;z-index:1060;max-width:276px;text-align:left;text-align:start;background-color:#fff;border:1px solid rgba(0,0,0,.2);border-radius:.3rem}.popover .arrow{width:1rem;height:.5rem;margin:0 .3rem}.popover .arrow::after,.popover .arrow::before{content:"";border-color:transparent;border-style:solid}.bs-popover-auto[x-placement^=top],.bs-popover-top{margin-bottom:.5rem}.bs-popover-auto[x-placement^=top] .arrow,.bs-popover-top .arrow{bottom:calc((.5rem + 1px) * -1)}.bs-popover-auto[x-placement^=top] .arrow::after,.bs-popover-auto[x-placement^=top] .arrow::before,.bs-popover-top .arrow::after,.bs-popover-top .arrow::before{border-width:.5rem .5rem 0}.bs-popover-auto[x-placement^=top] .arrow::before,.bs-popover-top .arrow::before{bottom:0;border-top-color:rgba(0,0,0,.25)}.bs-popover-auto[x-placement^=top] .arrow::after,.bs-popover-top .arrow::after{bottom:1px;border-top-color:#fff}.bs-popover-auto[x-placement^=right],.bs-popover-right{margin-left:.5rem}.bs-popover-auto[x-placement^=right] .arrow,.bs-popover-right .arrow{left:calc((.5rem + 1px) * -1);width:.5rem;height:1rem;margin:.3rem 0}.bs-popover-auto[x-placement^=right] .arrow::after,.bs-popover-auto[x-placement^=right] .arrow::before,.bs-popover-right .arrow::after,.bs-popover-right .arrow::before{border-width:.5rem .5rem .5rem 0}.bs-popover-auto[x-placement^=right] .arrow::before,.bs-popover-right .arrow::before{left:0;border-right-color:rgba(0,0,0,.25)}.bs-popover-auto[x-placement^=right] .arrow::after,.bs-popover-right .arrow::after{left:1px;border-right-color:#fff}.bs-popover-auto[x-placement^=bottom],.bs-popover-bottom{margin-top:.5rem}.bs-popover-auto[x-placement^=bottom] .arrow,.bs-popover-bottom .arrow{top:calc((.5rem + 1px) * -1)}.bs-popover-auto[x-placement^=bottom] .arrow::after,.bs-popover-auto[x-placement^=bottom] .arrow::before,.bs-popover-bottom .arrow::after,.bs-popover-bottom .arrow::before{border-width:0 .5rem .5rem}.bs-popover-auto[x-placement^=bottom] .arrow::before,.bs-popover-bottom .arrow::before{top:0;border-bottom-color:rgba(0,0,0,.25)}.bs-popover-auto[x-placement^=bottom] .arrow::after,.bs-popover-bottom .arrow::after{top:1px;border-bottom-color:#fff}.bs-popover-auto[x-placement^=bottom] .popover-header::before,.bs-popover-bottom .popover-header::before{position:absolute;top:0;left:50%;display:block;width:1rem;margin-left:-.5rem;content:"";border-bottom:1px solid #f7f7f7}.carousel,.carousel-inner,.carousel-item{position:relative}.bs-popover-auto[x-placement^=left],.bs-popover-left{margin-right:.5rem}.bs-popover-auto[x-placement^=left] .arrow,.bs-popover-left .arrow{right:calc((.5rem + 1px) * -1);width:.5rem;height:1rem;margin:.3rem 0}.bs-popover-auto[x-placement^=left] .arrow::after,.bs-popover-auto[x-placement^=left] .arrow::before,.bs-popover-left .arrow::after,.bs-popover-left .arrow::before{border-width:.5rem 0 .5rem .5rem}.bs-popover-auto[x-placement^=left] .arrow::before,.bs-popover-left .arrow::before{right:0;border-left-color:rgba(0,0,0,.25)}.bs-popover-auto[x-placement^=left] .arrow::after,.bs-popover-left .arrow::after{right:1px;border-left-color:#fff}.popover-header{padding:.5rem .75rem;margin-bottom:0;font-size:1rem;color:inherit;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;border-top-left-radius:calc(.3rem - 1px);border-top-right-radius:calc(.3rem - 1px)}.popover-header:empty{display:none}.popover-body{padding:.5rem .75rem;color:#212529}.carousel-inner{width:100%;overflow:hidden}.carousel-item{display:none;align-items:center;width:100%;backface-visibility:hidden;perspective:1000px}.carousel-item-next,.carousel-item-prev,.carousel-item.active{display:block;transition:transform .6s ease}@media screen and (prefers-reduced-motion:reduce){.carousel-item-next,.carousel-item-prev,.carousel-item.active{transition:none}}.carousel-item-next,.carousel-item-prev{position:absolute;top:0}.carousel-item-next.carousel-item-left,.carousel-item-prev.carousel-item-right{transform:translateX(0)}@supports (transform-style:preserve-3d){.carousel-item-next.carousel-item-left,.carousel-item-prev.carousel-item-right{transform:translate3d(0,0,0)}}.active.carousel-item-right,.carousel-item-next{transform:translateX(100%)}@supports (transform-style:preserve-3d){.active.carousel-item-right,.carousel-item-next{transform:translate3d(100%,0,0)}}.active.carousel-item-left,.carousel-item-prev{transform:translateX(-100%)}@supports (transform-style:preserve-3d){.active.carousel-item-left,.carousel-item-prev{transform:translate3d(-100%,0,0)}}.carousel-fade .carousel-item{opacity:0;transition-duration:.6s;transition-property:opacity}.carousel-fade .carousel-item-next.carousel-item-left,.carousel-fade .carousel-item-prev.carousel-item-right,.carousel-fade .carousel-item.active{opacity:1}.carousel-fade .active.carousel-item-left,.carousel-fade .active.carousel-item-right{opacity:0}.carousel-fade .active.carousel-item-left,.carousel-fade .active.carousel-item-prev,.carousel-fade .carousel-item-next,.carousel-fade .carousel-item-prev,.carousel-fade .carousel-item.active{transform:translateX(0)}@supports (transform-style:preserve-3d){.carousel-fade .active.carousel-item-left,.carousel-fade .active.carousel-item-prev,.carousel-fade .carousel-item-next,.carousel-fade .carousel-item-prev,.carousel-fade .carousel-item.active{transform:translate3d(0,0,0)}}.carousel-control-next,.carousel-control-prev{position:absolute;top:0;bottom:0;display:flex;align-items:center;justify-content:center;width:15%;color:#fff;text-align:center;opacity:.5}.carousel-control-next:focus,.carousel-control-next:hover,.carousel-control-prev:focus,.carousel-control-prev:hover{color:#fff;text-decoration:none;outline:0;opacity:.9}.carousel-control-prev{left:0}.carousel-control-next{right:0}.carousel-control-next-icon,.carousel-control-prev-icon{display:inline-block;width:20px;height:20px;background:center center no-repeat;background-size:100% 100%}.carousel-control-prev-icon{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 8 8'%3E%3Cpath d='M5.25 0l-4 4 4 4 1.5-1.5-2.5-2.5 2.5-2.5-1.5-1.5z'/%3E%3C/svg%3E")}.carousel-control-next-icon{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 8 8'%3E%3Cpath d='M2.75 0l-1.5 1.5 2.5 2.5-2.5 2.5 1.5 1.5 4-4-4-4z'/%3E%3C/svg%3E")}.carousel-indicators{position:absolute;right:0;bottom:10px;left:0;z-index:15;display:flex;justify-content:center;padding-left:0;margin-right:15%;margin-left:15%;list-style:none}.carousel-indicators li{position:relative;flex:0 1 auto;width:30px;height:3px;margin-right:3px;margin-left:3px;text-indent:-999px;background-color:rgba(255,255,255,.5)}.carousel-indicators li::after,.carousel-indicators li::before{left:0;display:inline-block;height:10px;position:absolute;content:"";width:100%}.carousel-indicators li::before{top:-10px}.carousel-indicators li::after{bottom:-10px}.carousel-indicators .active{background-color:#fff}.carousel-caption{position:absolute;right:15%;bottom:20px;left:15%;z-index:10;padding-top:20px;padding-bottom:20px;color:#fff;text-align:center}.align-baseline{vertical-align:baseline!important}.align-top{vertical-align:top!important}.align-middle{vertical-align:middle!important}.align-bottom{vertical-align:bottom!important}.align-text-bottom{vertical-align:text-bottom!important}.align-text-top{vertical-align:text-top!important}.bg-primary{background-color:#007bff!important}a.bg-primary:focus,a.bg-primary:hover,button.bg-primary:focus,button.bg-primary:hover{background-color:#0062cc!important}.bg-secondary{background-color:#6c757d!important}a.bg-secondary:focus,a.bg-secondary:hover,button.bg-secondary:focus,button.bg-secondary:hover{background-color:#545b62!important}.bg-success{background-color:#28a745!important}a.bg-success:focus,a.bg-success:hover,button.bg-success:focus,button.bg-success:hover{background-color:#1e7e34!important}.bg-info{background-color:#17a2b8!important}a.bg-info:focus,a.bg-info:hover,button.bg-info:focus,button.bg-info:hover{background-color:#117a8b!important}.bg-warning{background-color:#ffc107!important}a.bg-warning:focus,a.bg-warning:hover,button.bg-warning:focus,button.bg-warning:hover{background-color:#d39e00!important}.bg-danger{background-color:#dc3545!important}a.bg-danger:focus,a.bg-danger:hover,button.bg-danger:focus,button.bg-danger:hover{background-color:#bd2130!important}.bg-light{background-color:#f8f9fa!important}a.bg-light:focus,a.bg-light:hover,button.bg-light:focus,button.bg-light:hover{background-color:#dae0e5!important}.bg-dark{background-color:#343a40!important}a.bg-dark:focus,a.bg-dark:hover,button.bg-dark:focus,button.bg-dark:hover{background-color:#1d2124!important}.bg-white{background-color:#fff!important}.bg-transparent{background-color:transparent!important}.border{border:1px solid #dee2e6!important}.border-top{border-top:1px solid #dee2e6!important}.border-right{border-right:1px solid #dee2e6!important}.border-bottom{border-bottom:1px solid #dee2e6!important}.border-left{border-left:1px solid #dee2e6!important}.border-0{border:0!important}.rounded-right,.rounded-top{border-top-right-radius:.25rem!important}.rounded-bottom,.rounded-right{border-bottom-right-radius:.25rem!important}.rounded-left,.rounded-top{border-top-left-radius:.25rem!important}.rounded-bottom,.rounded-left{border-bottom-left-radius:.25rem!important}.border-top-0{border-top:0!important}.border-right-0{border-right:0!important}.border-bottom-0{border-bottom:0!important}.border-left-0{border-left:0!important}.border-primary{border-color:#007bff!important}.border-secondary{border-color:#6c757d!important}.border-success{border-color:#28a745!important}.border-info{border-color:#17a2b8!important}.border-warning{border-color:#ffc107!important}.border-danger{border-color:#dc3545!important}.border-light{border-color:#f8f9fa!important}.border-dark{border-color:#343a40!important}.border-white{border-color:#fff!important}.rounded{border-radius:.25rem!important}.rounded-circle{border-radius:50%!important}.rounded-0{border-radius:0!important}.clearfix::after{display:block;clear:both;content:""}.d-none{display:none!important}.d-inline{display:inline!important}.d-inline-block{display:inline-block!important}.d-block{display:block!important}.d-table{display:table!important}.d-table-row{display:table-row!important}.d-table-cell{display:table-cell!important}.d-flex{display:flex!important}.d-inline-flex{display:inline-flex!important}@media (min-width:576px){.d-sm-none{display:none!important}.d-sm-inline{display:inline!important}.d-sm-inline-block{display:inline-block!important}.d-sm-block{display:block!important}.d-sm-table{display:table!important}.d-sm-table-row{display:table-row!important}.d-sm-table-cell{display:table-cell!important}.d-sm-flex{display:flex!important}.d-sm-inline-flex{display:inline-flex!important}}@media (min-width:768px){.d-md-none{display:none!important}.d-md-inline{display:inline!important}.d-md-inline-block{display:inline-block!important}.d-md-block{display:block!important}.d-md-table{display:table!important}.d-md-table-row{display:table-row!important}.d-md-table-cell{display:table-cell!important}.d-md-flex{display:flex!important}.d-md-inline-flex{display:inline-flex!important}}@media (min-width:992px){.d-lg-none{display:none!important}.d-lg-inline{display:inline!important}.d-lg-inline-block{display:inline-block!important}.d-lg-block{display:block!important}.d-lg-table{display:table!important}.d-lg-table-row{display:table-row!important}.d-lg-table-cell{display:table-cell!important}.d-lg-flex{display:flex!important}.d-lg-inline-flex{display:inline-flex!important}}@media (min-width:1200px){.d-xl-none{display:none!important}.d-xl-inline{display:inline!important}.d-xl-inline-block{display:inline-block!important}.d-xl-block{display:block!important}.d-xl-table{display:table!important}.d-xl-table-row{display:table-row!important}.d-xl-table-cell{display:table-cell!important}.d-xl-flex{display:flex!important}.d-xl-inline-flex{display:inline-flex!important}}@media print{.d-print-none{display:none!important}.d-print-inline{display:inline!important}.d-print-inline-block{display:inline-block!important}.d-print-block{display:block!important}.d-print-table{display:table!important}.d-print-table-row{display:table-row!important}.d-print-table-cell{display:table-cell!important}.d-print-flex{display:flex!important}.d-print-inline-flex{display:inline-flex!important}}.embed-responsive{position:relative;display:block;width:100%;padding:0;overflow:hidden}.embed-responsive::before{display:block;content:""}.embed-responsive .embed-responsive-item,.embed-responsive embed,.embed-responsive iframe,.embed-responsive object,.embed-responsive video{position:absolute;top:0;bottom:0;left:0;width:100%;height:100%;border:0}.embed-responsive-21by9::before{padding-top:42.85714%}.embed-responsive-16by9::before{padding-top:56.25%}.embed-responsive-4by3::before{padding-top:75%}.embed-responsive-1by1::before{padding-top:100%}.flex-row{flex-direction:row!important}.flex-column{flex-direction:column!important}.flex-row-reverse{flex-direction:row-reverse!important}.flex-column-reverse{flex-direction:column-reverse!important}.flex-wrap{flex-wrap:wrap!important}.flex-nowrap{flex-wrap:nowrap!important}.flex-wrap-reverse{flex-wrap:wrap-reverse!important}.flex-fill{flex:1 1 auto!important}.flex-grow-0{flex-grow:0!important}.flex-grow-1{flex-grow:1!important}.flex-shrink-0{flex-shrink:0!important}.flex-shrink-1{flex-shrink:1!important}.justify-content-start{justify-content:flex-start!important}.justify-content-end{justify-content:flex-end!important}.justify-content-center{justify-content:center!important}.justify-content-between{justify-content:space-between!important}.justify-content-around{justify-content:space-around!important}.align-items-start{align-items:flex-start!important}.align-items-end{align-items:flex-end!important}.align-items-center{align-items:center!important}.align-items-baseline{align-items:baseline!important}.align-items-stretch{align-items:stretch!important}.align-content-start{align-content:flex-start!important}.align-content-end{align-content:flex-end!important}.align-content-center{align-content:center!important}.align-content-between{align-content:space-between!important}.align-content-around{align-content:space-around!important}.align-content-stretch{align-content:stretch!important}.align-self-auto{align-self:auto!important}.align-self-start{align-self:flex-start!important}.align-self-end{align-self:flex-end!important}.align-self-center{align-self:center!important}.align-self-baseline{align-self:baseline!important}.align-self-stretch{align-self:stretch!important}.float-left{float:left!important}.float-right{float:right!important}.float-none{float:none!important}.position-static{position:static!important}.position-relative{position:relative!important}.position-absolute{position:absolute!important}.position-fixed{position:fixed!important}.position-sticky{position:sticky!important}.fixed-bottom,.fixed-top{position:fixed;z-index:1030;right:0;left:0}.fixed-top{top:0}.fixed-bottom{bottom:0}@supports (position:sticky){.sticky-top{position:sticky;top:0;z-index:1020}}.sr-only{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;overflow:visible;clip:auto;white-space:normal}.shadow-sm{box-shadow:0 .125rem .25rem rgba(0,0,0,.075)!important}.shadow{box-shadow:0 .5rem 1rem rgba(0,0,0,.15)!important}.shadow-lg{box-shadow:0 1rem 3rem rgba(0,0,0,.175)!important}.shadow-none{box-shadow:none!important}.w-25{width:25%!important}.w-50{width:50%!important}.w-75{width:75%!important}.w-100{width:100%!important}.w-auto{width:auto!important}.h-25{height:25%!important}.h-50{height:50%!important}.h-75{height:75%!important}.h-100{height:100%!important}.h-auto{height:auto!important}.mw-100{max-width:100%!important}.mh-100{max-height:100%!important}.m-0{margin:0!important}.mt-0,.my-0{margin-top:0!important}.mr-0,.mx-0{margin-right:0!important}.mb-0,.my-0{margin-bottom:0!important}.ml-0,.mx-0{margin-left:0!important}.m-1{margin:.25rem!important}.mt-1,.my-1{margin-top:.25rem!important}.mr-1,.mx-1{margin-right:.25rem!important}.mb-1,.my-1{margin-bottom:.25rem!important}.ml-1,.mx-1{margin-left:.25rem!important}.m-2{margin:.5rem!important}.mt-2,.my-2{margin-top:.5rem!important}.mr-2,.mx-2{margin-right:.5rem!important}.mb-2,.my-2{margin-bottom:.5rem!important}.ml-2,.mx-2{margin-left:.5rem!important}.m-3{margin:1rem!important}.mt-3,.my-3{margin-top:1rem!important}.mr-3,.mx-3{margin-right:1rem!important}.mb-3,.my-3{margin-bottom:1rem!important}.ml-3,.mx-3{margin-left:1rem!important}.m-4{margin:1.5rem!important}.mt-4,.my-4{margin-top:1.5rem!important}.mr-4,.mx-4{margin-right:1.5rem!important}.mb-4,.my-4{margin-bottom:1.5rem!important}.ml-4,.mx-4{margin-left:1.5rem!important}.m-5{margin:3rem!important}.mt-5,.my-5{margin-top:3rem!important}.mr-5,.mx-5{margin-right:3rem!important}.mb-5,.my-5{margin-bottom:3rem!important}.ml-5,.mx-5{margin-left:3rem!important}.p-0{padding:0!important}.pt-0,.py-0{padding-top:0!important}.pr-0,.px-0{padding-right:0!important}.pb-0,.py-0{padding-bottom:0!important}.pl-0,.px-0{padding-left:0!important}.p-1{padding:.25rem!important}.pt-1,.py-1{padding-top:.25rem!important}.pr-1,.px-1{padding-right:.25rem!important}.pb-1,.py-1{padding-bottom:.25rem!important}.pl-1,.px-1{padding-left:.25rem!important}.p-2{padding:.5rem!important}.pt-2,.py-2{padding-top:.5rem!important}.pr-2,.px-2{padding-right:.5rem!important}.pb-2,.py-2{padding-bottom:.5rem!important}.pl-2,.px-2{padding-left:.5rem!important}.p-3{padding:1rem!important}.pt-3,.py-3{padding-top:1rem!important}.pr-3,.px-3{padding-right:1rem!important}.pb-3,.py-3{padding-bottom:1rem!important}.pl-3,.px-3{padding-left:1rem!important}.p-4{padding:1.5rem!important}.pt-4,.py-4{padding-top:1.5rem!important}.pr-4,.px-4{padding-right:1.5rem!important}.pb-4,.py-4{padding-bottom:1.5rem!important}.pl-4,.px-4{padding-left:1.5rem!important}.p-5{padding:3rem!important}.pt-5,.py-5{padding-top:3rem!important}.pr-5,.px-5{padding-right:3rem!important}.pb-5,.py-5{padding-bottom:3rem!important}.pl-5,.px-5{padding-left:3rem!important}.m-auto{margin:auto!important}.mt-auto,.my-auto{margin-top:auto!important}.mr-auto,.mx-auto{margin-right:auto!important}.mb-auto,.my-auto{margin-bottom:auto!important}.ml-auto,.mx-auto{margin-left:auto!important}.text-justify{text-align:justify!important}.text-nowrap{white-space:nowrap!important}.text-truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.right-panel,ul.modules{bottom:0;overflow-x:auto}.text-left{text-align:left!important}.text-right{text-align:right!important}.text-center{text-align:center!important}@media (min-width:576px){.flex-sm-row{flex-direction:row!important}.flex-sm-column{flex-direction:column!important}.flex-sm-row-reverse{flex-direction:row-reverse!important}.flex-sm-column-reverse{flex-direction:column-reverse!important}.flex-sm-wrap{flex-wrap:wrap!important}.flex-sm-nowrap{flex-wrap:nowrap!important}.flex-sm-wrap-reverse{flex-wrap:wrap-reverse!important}.flex-sm-fill{flex:1 1 auto!important}.flex-sm-grow-0{flex-grow:0!important}.flex-sm-grow-1{flex-grow:1!important}.flex-sm-shrink-0{flex-shrink:0!important}.flex-sm-shrink-1{flex-shrink:1!important}.justify-content-sm-start{justify-content:flex-start!important}.justify-content-sm-end{justify-content:flex-end!important}.justify-content-sm-center{justify-content:center!important}.justify-content-sm-between{justify-content:space-between!important}.justify-content-sm-around{justify-content:space-around!important}.align-items-sm-start{align-items:flex-start!important}.align-items-sm-end{align-items:flex-end!important}.align-items-sm-center{align-items:center!important}.align-items-sm-baseline{align-items:baseline!important}.align-items-sm-stretch{align-items:stretch!important}.align-content-sm-start{align-content:flex-start!important}.align-content-sm-end{align-content:flex-end!important}.align-content-sm-center{align-content:center!important}.align-content-sm-between{align-content:space-between!important}.align-content-sm-around{align-content:space-around!important}.align-content-sm-stretch{align-content:stretch!important}.align-self-sm-auto{align-self:auto!important}.align-self-sm-start{align-self:flex-start!important}.align-self-sm-end{align-self:flex-end!important}.align-self-sm-center{align-self:center!important}.align-self-sm-baseline{align-self:baseline!important}.align-self-sm-stretch{align-self:stretch!important}.float-sm-left{float:left!important}.float-sm-right{float:right!important}.float-sm-none{float:none!important}.m-sm-0{margin:0!important}.mt-sm-0,.my-sm-0{margin-top:0!important}.mr-sm-0,.mx-sm-0{margin-right:0!important}.mb-sm-0,.my-sm-0{margin-bottom:0!important}.ml-sm-0,.mx-sm-0{margin-left:0!important}.m-sm-1{margin:.25rem!important}.mt-sm-1,.my-sm-1{margin-top:.25rem!important}.mr-sm-1,.mx-sm-1{margin-right:.25rem!important}.mb-sm-1,.my-sm-1{margin-bottom:.25rem!important}.ml-sm-1,.mx-sm-1{margin-left:.25rem!important}.m-sm-2{margin:.5rem!important}.mt-sm-2,.my-sm-2{margin-top:.5rem!important}.mr-sm-2,.mx-sm-2{margin-right:.5rem!important}.mb-sm-2,.my-sm-2{margin-bottom:.5rem!important}.ml-sm-2,.mx-sm-2{margin-left:.5rem!important}.m-sm-3{margin:1rem!important}.mt-sm-3,.my-sm-3{margin-top:1rem!important}.mr-sm-3,.mx-sm-3{margin-right:1rem!important}.mb-sm-3,.my-sm-3{margin-bottom:1rem!important}.ml-sm-3,.mx-sm-3{margin-left:1rem!important}.m-sm-4{margin:1.5rem!important}.mt-sm-4,.my-sm-4{margin-top:1.5rem!important}.mr-sm-4,.mx-sm-4{margin-right:1.5rem!important}.mb-sm-4,.my-sm-4{margin-bottom:1.5rem!important}.ml-sm-4,.mx-sm-4{margin-left:1.5rem!important}.m-sm-5{margin:3rem!important}.mt-sm-5,.my-sm-5{margin-top:3rem!important}.mr-sm-5,.mx-sm-5{margin-right:3rem!important}.mb-sm-5,.my-sm-5{margin-bottom:3rem!important}.ml-sm-5,.mx-sm-5{margin-left:3rem!important}.p-sm-0{padding:0!important}.pt-sm-0,.py-sm-0{padding-top:0!important}.pr-sm-0,.px-sm-0{padding-right:0!important}.pb-sm-0,.py-sm-0{padding-bottom:0!important}.pl-sm-0,.px-sm-0{padding-left:0!important}.p-sm-1{padding:.25rem!important}.pt-sm-1,.py-sm-1{padding-top:.25rem!important}.pr-sm-1,.px-sm-1{padding-right:.25rem!important}.pb-sm-1,.py-sm-1{padding-bottom:.25rem!important}.pl-sm-1,.px-sm-1{padding-left:.25rem!important}.p-sm-2{padding:.5rem!important}.pt-sm-2,.py-sm-2{padding-top:.5rem!important}.pr-sm-2,.px-sm-2{padding-right:.5rem!important}.pb-sm-2,.py-sm-2{padding-bottom:.5rem!important}.pl-sm-2,.px-sm-2{padding-left:.5rem!important}.p-sm-3{padding:1rem!important}.pt-sm-3,.py-sm-3{padding-top:1rem!important}.pr-sm-3,.px-sm-3{padding-right:1rem!important}.pb-sm-3,.py-sm-3{padding-bottom:1rem!important}.pl-sm-3,.px-sm-3{padding-left:1rem!important}.p-sm-4{padding:1.5rem!important}.pt-sm-4,.py-sm-4{padding-top:1.5rem!important}.pr-sm-4,.px-sm-4{padding-right:1.5rem!important}.pb-sm-4,.py-sm-4{padding-bottom:1.5rem!important}.pl-sm-4,.px-sm-4{padding-left:1.5rem!important}.p-sm-5{padding:3rem!important}.pt-sm-5,.py-sm-5{padding-top:3rem!important}.pr-sm-5,.px-sm-5{padding-right:3rem!important}.pb-sm-5,.py-sm-5{padding-bottom:3rem!important}.pl-sm-5,.px-sm-5{padding-left:3rem!important}.m-sm-auto{margin:auto!important}.mt-sm-auto,.my-sm-auto{margin-top:auto!important}.mr-sm-auto,.mx-sm-auto{margin-right:auto!important}.mb-sm-auto,.my-sm-auto{margin-bottom:auto!important}.ml-sm-auto,.mx-sm-auto{margin-left:auto!important}.text-sm-left{text-align:left!important}.text-sm-right{text-align:right!important}.text-sm-center{text-align:center!important}}@media (min-width:768px){.flex-md-row{flex-direction:row!important}.flex-md-column{flex-direction:column!important}.flex-md-row-reverse{flex-direction:row-reverse!important}.flex-md-column-reverse{flex-direction:column-reverse!important}.flex-md-wrap{flex-wrap:wrap!important}.flex-md-nowrap{flex-wrap:nowrap!important}.flex-md-wrap-reverse{flex-wrap:wrap-reverse!important}.flex-md-fill{flex:1 1 auto!important}.flex-md-grow-0{flex-grow:0!important}.flex-md-grow-1{flex-grow:1!important}.flex-md-shrink-0{flex-shrink:0!important}.flex-md-shrink-1{flex-shrink:1!important}.justify-content-md-start{justify-content:flex-start!important}.justify-content-md-end{justify-content:flex-end!important}.justify-content-md-center{justify-content:center!important}.justify-content-md-between{justify-content:space-between!important}.justify-content-md-around{justify-content:space-around!important}.align-items-md-start{align-items:flex-start!important}.align-items-md-end{align-items:flex-end!important}.align-items-md-center{align-items:center!important}.align-items-md-baseline{align-items:baseline!important}.align-items-md-stretch{align-items:stretch!important}.align-content-md-start{align-content:flex-start!important}.align-content-md-end{align-content:flex-end!important}.align-content-md-center{align-content:center!important}.align-content-md-between{align-content:space-between!important}.align-content-md-around{align-content:space-around!important}.align-content-md-stretch{align-content:stretch!important}.align-self-md-auto{align-self:auto!important}.align-self-md-start{align-self:flex-start!important}.align-self-md-end{align-self:flex-end!important}.align-self-md-center{align-self:center!important}.align-self-md-baseline{align-self:baseline!important}.align-self-md-stretch{align-self:stretch!important}.float-md-left{float:left!important}.float-md-right{float:right!important}.float-md-none{float:none!important}.m-md-0{margin:0!important}.mt-md-0,.my-md-0{margin-top:0!important}.mr-md-0,.mx-md-0{margin-right:0!important}.mb-md-0,.my-md-0{margin-bottom:0!important}.ml-md-0,.mx-md-0{margin-left:0!important}.m-md-1{margin:.25rem!important}.mt-md-1,.my-md-1{margin-top:.25rem!important}.mr-md-1,.mx-md-1{margin-right:.25rem!important}.mb-md-1,.my-md-1{margin-bottom:.25rem!important}.ml-md-1,.mx-md-1{margin-left:.25rem!important}.m-md-2{margin:.5rem!important}.mt-md-2,.my-md-2{margin-top:.5rem!important}.mr-md-2,.mx-md-2{margin-right:.5rem!important}.mb-md-2,.my-md-2{margin-bottom:.5rem!important}.ml-md-2,.mx-md-2{margin-left:.5rem!important}.m-md-3{margin:1rem!important}.mt-md-3,.my-md-3{margin-top:1rem!important}.mr-md-3,.mx-md-3{margin-right:1rem!important}.mb-md-3,.my-md-3{margin-bottom:1rem!important}.ml-md-3,.mx-md-3{margin-left:1rem!important}.m-md-4{margin:1.5rem!important}.mt-md-4,.my-md-4{margin-top:1.5rem!important}.mr-md-4,.mx-md-4{margin-right:1.5rem!important}.mb-md-4,.my-md-4{margin-bottom:1.5rem!important}.ml-md-4,.mx-md-4{margin-left:1.5rem!important}.m-md-5{margin:3rem!important}.mt-md-5,.my-md-5{margin-top:3rem!important}.mr-md-5,.mx-md-5{margin-right:3rem!important}.mb-md-5,.my-md-5{margin-bottom:3rem!important}.ml-md-5,.mx-md-5{margin-left:3rem!important}.p-md-0{padding:0!important}.pt-md-0,.py-md-0{padding-top:0!important}.pr-md-0,.px-md-0{padding-right:0!important}.pb-md-0,.py-md-0{padding-bottom:0!important}.pl-md-0,.px-md-0{padding-left:0!important}.p-md-1{padding:.25rem!important}.pt-md-1,.py-md-1{padding-top:.25rem!important}.pr-md-1,.px-md-1{padding-right:.25rem!important}.pb-md-1,.py-md-1{padding-bottom:.25rem!important}.pl-md-1,.px-md-1{padding-left:.25rem!important}.p-md-2{padding:.5rem!important}.pt-md-2,.py-md-2{padding-top:.5rem!important}.pr-md-2,.px-md-2{padding-right:.5rem!important}.pb-md-2,.py-md-2{padding-bottom:.5rem!important}.pl-md-2,.px-md-2{padding-left:.5rem!important}.p-md-3{padding:1rem!important}.pt-md-3,.py-md-3{padding-top:1rem!important}.pr-md-3,.px-md-3{padding-right:1rem!important}.pb-md-3,.py-md-3{padding-bottom:1rem!important}.pl-md-3,.px-md-3{padding-left:1rem!important}.p-md-4{padding:1.5rem!important}.pt-md-4,.py-md-4{padding-top:1.5rem!important}.pr-md-4,.px-md-4{padding-right:1.5rem!important}.pb-md-4,.py-md-4{padding-bottom:1.5rem!important}.pl-md-4,.px-md-4{padding-left:1.5rem!important}.p-md-5{padding:3rem!important}.pt-md-5,.py-md-5{padding-top:3rem!important}.pr-md-5,.px-md-5{padding-right:3rem!important}.pb-md-5,.py-md-5{padding-bottom:3rem!important}.pl-md-5,.px-md-5{padding-left:3rem!important}.m-md-auto{margin:auto!important}.mt-md-auto,.my-md-auto{margin-top:auto!important}.mr-md-auto,.mx-md-auto{margin-right:auto!important}.mb-md-auto,.my-md-auto{margin-bottom:auto!important}.ml-md-auto,.mx-md-auto{margin-left:auto!important}.text-md-left{text-align:left!important}.text-md-right{text-align:right!important}.text-md-center{text-align:center!important}}@media (min-width:992px){.flex-lg-row{flex-direction:row!important}.flex-lg-column{flex-direction:column!important}.flex-lg-row-reverse{flex-direction:row-reverse!important}.flex-lg-column-reverse{flex-direction:column-reverse!important}.flex-lg-wrap{flex-wrap:wrap!important}.flex-lg-nowrap{flex-wrap:nowrap!important}.flex-lg-wrap-reverse{flex-wrap:wrap-reverse!important}.flex-lg-fill{flex:1 1 auto!important}.flex-lg-grow-0{flex-grow:0!important}.flex-lg-grow-1{flex-grow:1!important}.flex-lg-shrink-0{flex-shrink:0!important}.flex-lg-shrink-1{flex-shrink:1!important}.justify-content-lg-start{justify-content:flex-start!important}.justify-content-lg-end{justify-content:flex-end!important}.justify-content-lg-center{justify-content:center!important}.justify-content-lg-between{justify-content:space-between!important}.justify-content-lg-around{justify-content:space-around!important}.align-items-lg-start{align-items:flex-start!important}.align-items-lg-end{align-items:flex-end!important}.align-items-lg-center{align-items:center!important}.align-items-lg-baseline{align-items:baseline!important}.align-items-lg-stretch{align-items:stretch!important}.align-content-lg-start{align-content:flex-start!important}.align-content-lg-end{align-content:flex-end!important}.align-content-lg-center{align-content:center!important}.align-content-lg-between{align-content:space-between!important}.align-content-lg-around{align-content:space-around!important}.align-content-lg-stretch{align-content:stretch!important}.align-self-lg-auto{align-self:auto!important}.align-self-lg-start{align-self:flex-start!important}.align-self-lg-end{align-self:flex-end!important}.align-self-lg-center{align-self:center!important}.align-self-lg-baseline{align-self:baseline!important}.align-self-lg-stretch{align-self:stretch!important}.float-lg-left{float:left!important}.float-lg-right{float:right!important}.float-lg-none{float:none!important}.m-lg-0{margin:0!important}.mt-lg-0,.my-lg-0{margin-top:0!important}.mr-lg-0,.mx-lg-0{margin-right:0!important}.mb-lg-0,.my-lg-0{margin-bottom:0!important}.ml-lg-0,.mx-lg-0{margin-left:0!important}.m-lg-1{margin:.25rem!important}.mt-lg-1,.my-lg-1{margin-top:.25rem!important}.mr-lg-1,.mx-lg-1{margin-right:.25rem!important}.mb-lg-1,.my-lg-1{margin-bottom:.25rem!important}.ml-lg-1,.mx-lg-1{margin-left:.25rem!important}.m-lg-2{margin:.5rem!important}.mt-lg-2,.my-lg-2{margin-top:.5rem!important}.mr-lg-2,.mx-lg-2{margin-right:.5rem!important}.mb-lg-2,.my-lg-2{margin-bottom:.5rem!important}.ml-lg-2,.mx-lg-2{margin-left:.5rem!important}.m-lg-3{margin:1rem!important}.mt-lg-3,.my-lg-3{margin-top:1rem!important}.mr-lg-3,.mx-lg-3{margin-right:1rem!important}.mb-lg-3,.my-lg-3{margin-bottom:1rem!important}.ml-lg-3,.mx-lg-3{margin-left:1rem!important}.m-lg-4{margin:1.5rem!important}.mt-lg-4,.my-lg-4{margin-top:1.5rem!important}.mr-lg-4,.mx-lg-4{margin-right:1.5rem!important}.mb-lg-4,.my-lg-4{margin-bottom:1.5rem!important}.ml-lg-4,.mx-lg-4{margin-left:1.5rem!important}.m-lg-5{margin:3rem!important}.mt-lg-5,.my-lg-5{margin-top:3rem!important}.mr-lg-5,.mx-lg-5{margin-right:3rem!important}.mb-lg-5,.my-lg-5{margin-bottom:3rem!important}.ml-lg-5,.mx-lg-5{margin-left:3rem!important}.p-lg-0{padding:0!important}.pt-lg-0,.py-lg-0{padding-top:0!important}.pr-lg-0,.px-lg-0{padding-right:0!important}.pb-lg-0,.py-lg-0{padding-bottom:0!important}.pl-lg-0,.px-lg-0{padding-left:0!important}.p-lg-1{padding:.25rem!important}.pt-lg-1,.py-lg-1{padding-top:.25rem!important}.pr-lg-1,.px-lg-1{padding-right:.25rem!important}.pb-lg-1,.py-lg-1{padding-bottom:.25rem!important}.pl-lg-1,.px-lg-1{padding-left:.25rem!important}.p-lg-2{padding:.5rem!important}.pt-lg-2,.py-lg-2{padding-top:.5rem!important}.pr-lg-2,.px-lg-2{padding-right:.5rem!important}.pb-lg-2,.py-lg-2{padding-bottom:.5rem!important}.pl-lg-2,.px-lg-2{padding-left:.5rem!important}.p-lg-3{padding:1rem!important}.pt-lg-3,.py-lg-3{padding-top:1rem!important}.pr-lg-3,.px-lg-3{padding-right:1rem!important}.pb-lg-3,.py-lg-3{padding-bottom:1rem!important}.pl-lg-3,.px-lg-3{padding-left:1rem!important}.p-lg-4{padding:1.5rem!important}.pt-lg-4,.py-lg-4{padding-top:1.5rem!important}.pr-lg-4,.px-lg-4{padding-right:1.5rem!important}.pb-lg-4,.py-lg-4{padding-bottom:1.5rem!important}.pl-lg-4,.px-lg-4{padding-left:1.5rem!important}.p-lg-5{padding:3rem!important}.pt-lg-5,.py-lg-5{padding-top:3rem!important}.pr-lg-5,.px-lg-5{padding-right:3rem!important}.pb-lg-5,.py-lg-5{padding-bottom:3rem!important}.pl-lg-5,.px-lg-5{padding-left:3rem!important}.m-lg-auto{margin:auto!important}.mt-lg-auto,.my-lg-auto{margin-top:auto!important}.mr-lg-auto,.mx-lg-auto{margin-right:auto!important}.mb-lg-auto,.my-lg-auto{margin-bottom:auto!important}.ml-lg-auto,.mx-lg-auto{margin-left:auto!important}.text-lg-left{text-align:left!important}.text-lg-right{text-align:right!important}.text-lg-center{text-align:center!important}}@media (min-width:1200px){.flex-xl-row{flex-direction:row!important}.flex-xl-column{flex-direction:column!important}.flex-xl-row-reverse{flex-direction:row-reverse!important}.flex-xl-column-reverse{flex-direction:column-reverse!important}.flex-xl-wrap{flex-wrap:wrap!important}.flex-xl-nowrap{flex-wrap:nowrap!important}.flex-xl-wrap-reverse{flex-wrap:wrap-reverse!important}.flex-xl-fill{flex:1 1 auto!important}.flex-xl-grow-0{flex-grow:0!important}.flex-xl-grow-1{flex-grow:1!important}.flex-xl-shrink-0{flex-shrink:0!important}.flex-xl-shrink-1{flex-shrink:1!important}.justify-content-xl-start{justify-content:flex-start!important}.justify-content-xl-end{justify-content:flex-end!important}.justify-content-xl-center{justify-content:center!important}.justify-content-xl-between{justify-content:space-between!important}.justify-content-xl-around{justify-content:space-around!important}.align-items-xl-start{align-items:flex-start!important}.align-items-xl-end{align-items:flex-end!important}.align-items-xl-center{align-items:center!important}.align-items-xl-baseline{align-items:baseline!important}.align-items-xl-stretch{align-items:stretch!important}.align-content-xl-start{align-content:flex-start!important}.align-content-xl-end{align-content:flex-end!important}.align-content-xl-center{align-content:center!important}.align-content-xl-between{align-content:space-between!important}.align-content-xl-around{align-content:space-around!important}.align-content-xl-stretch{align-content:stretch!important}.align-self-xl-auto{align-self:auto!important}.align-self-xl-start{align-self:flex-start!important}.align-self-xl-end{align-self:flex-end!important}.align-self-xl-center{align-self:center!important}.align-self-xl-baseline{align-self:baseline!important}.align-self-xl-stretch{align-self:stretch!important}.float-xl-left{float:left!important}.float-xl-right{float:right!important}.float-xl-none{float:none!important}.m-xl-0{margin:0!important}.mt-xl-0,.my-xl-0{margin-top:0!important}.mr-xl-0,.mx-xl-0{margin-right:0!important}.mb-xl-0,.my-xl-0{margin-bottom:0!important}.ml-xl-0,.mx-xl-0{margin-left:0!important}.m-xl-1{margin:.25rem!important}.mt-xl-1,.my-xl-1{margin-top:.25rem!important}.mr-xl-1,.mx-xl-1{margin-right:.25rem!important}.mb-xl-1,.my-xl-1{margin-bottom:.25rem!important}.ml-xl-1,.mx-xl-1{margin-left:.25rem!important}.m-xl-2{margin:.5rem!important}.mt-xl-2,.my-xl-2{margin-top:.5rem!important}.mr-xl-2,.mx-xl-2{margin-right:.5rem!important}.mb-xl-2,.my-xl-2{margin-bottom:.5rem!important}.ml-xl-2,.mx-xl-2{margin-left:.5rem!important}.m-xl-3{margin:1rem!important}.mt-xl-3,.my-xl-3{margin-top:1rem!important}.mr-xl-3,.mx-xl-3{margin-right:1rem!important}.mb-xl-3,.my-xl-3{margin-bottom:1rem!important}.ml-xl-3,.mx-xl-3{margin-left:1rem!important}.m-xl-4{margin:1.5rem!important}.mt-xl-4,.my-xl-4{margin-top:1.5rem!important}.mr-xl-4,.mx-xl-4{margin-right:1.5rem!important}.mb-xl-4,.my-xl-4{margin-bottom:1.5rem!important}.ml-xl-4,.mx-xl-4{margin-left:1.5rem!important}.m-xl-5{margin:3rem!important}.mt-xl-5,.my-xl-5{margin-top:3rem!important}.mr-xl-5,.mx-xl-5{margin-right:3rem!important}.mb-xl-5,.my-xl-5{margin-bottom:3rem!important}.ml-xl-5,.mx-xl-5{margin-left:3rem!important}.p-xl-0{padding:0!important}.pt-xl-0,.py-xl-0{padding-top:0!important}.pr-xl-0,.px-xl-0{padding-right:0!important}.pb-xl-0,.py-xl-0{padding-bottom:0!important}.pl-xl-0,.px-xl-0{padding-left:0!important}.p-xl-1{padding:.25rem!important}.pt-xl-1,.py-xl-1{padding-top:.25rem!important}.pr-xl-1,.px-xl-1{padding-right:.25rem!important}.pb-xl-1,.py-xl-1{padding-bottom:.25rem!important}.pl-xl-1,.px-xl-1{padding-left:.25rem!important}.p-xl-2{padding:.5rem!important}.pt-xl-2,.py-xl-2{padding-top:.5rem!important}.pr-xl-2,.px-xl-2{padding-right:.5rem!important}.pb-xl-2,.py-xl-2{padding-bottom:.5rem!important}.pl-xl-2,.px-xl-2{padding-left:.5rem!important}.p-xl-3{padding:1rem!important}.pt-xl-3,.py-xl-3{padding-top:1rem!important}.pr-xl-3,.px-xl-3{padding-right:1rem!important}.pb-xl-3,.py-xl-3{padding-bottom:1rem!important}.pl-xl-3,.px-xl-3{padding-left:1rem!important}.p-xl-4{padding:1.5rem!important}.pt-xl-4,.py-xl-4{padding-top:1.5rem!important}.pr-xl-4,.px-xl-4{padding-right:1.5rem!important}.pb-xl-4,.py-xl-4{padding-bottom:1.5rem!important}.pl-xl-4,.px-xl-4{padding-left:1.5rem!important}.p-xl-5{padding:3rem!important}.pt-xl-5,.py-xl-5{padding-top:3rem!important}.pr-xl-5,.px-xl-5{padding-right:3rem!important}.pb-xl-5,.py-xl-5{padding-bottom:3rem!important}.pl-xl-5,.px-xl-5{padding-left:3rem!important}.m-xl-auto{margin:auto!important}.mt-xl-auto,.my-xl-auto{margin-top:auto!important}.mr-xl-auto,.mx-xl-auto{margin-right:auto!important}.mb-xl-auto,.my-xl-auto{margin-bottom:auto!important}.ml-xl-auto,.mx-xl-auto{margin-left:auto!important}.text-xl-left{text-align:left!important}.text-xl-right{text-align:right!important}.text-xl-center{text-align:center!important}}.text-lowercase{text-transform:lowercase!important}.text-uppercase{text-transform:uppercase!important}.text-capitalize{text-transform:capitalize!important}.font-weight-light{font-weight:300!important}.font-weight-normal{font-weight:400!important}.font-weight-bold{font-weight:700!important}.font-italic{font-style:italic!important}.text-white{color:#fff!important}.text-primary{color:#007bff!important}a.text-primary:focus,a.text-primary:hover{color:#0062cc!important}.text-secondary{color:#6c757d!important}a.text-secondary:focus,a.text-secondary:hover{color:#545b62!important}.text-success{color:#28a745!important}a.text-success:focus,a.text-success:hover{color:#1e7e34!important}.text-info{color:#17a2b8!important}a.text-info:focus,a.text-info:hover{color:#117a8b!important}.text-warning{color:#ffc107!important}a.text-warning:focus,a.text-warning:hover{color:#d39e00!important}.text-danger{color:#dc3545!important}a.text-danger:focus,a.text-danger:hover{color:#bd2130!important}.text-light{color:#f8f9fa!important}a.text-light:focus,a.text-light:hover{color:#dae0e5!important}.text-dark{color:#343a40!important}a.text-dark:focus,a.text-dark:hover{color:#1d2124!important}.text-body{color:#212529!important}.text-muted{color:#6c757d!important}.text-black-50{color:rgba(0,0,0,.5)!important}.text-white-50{color:rgba(255,255,255,.5)!important}.text-hide{font:0/0 a;color:transparent;background-color:transparent;border:0}.visible{visibility:visible!important}.invisible{visibility:hidden!important}@media print{blockquote,img,pre,tr{page-break-inside:avoid}*,::after,::before{text-shadow:none!important;box-shadow:none!important}a:not(.btn){text-decoration:underline}abbr[title]::after{content:" (" attr(title) ")"}pre{white-space:pre-wrap!important}blockquote,pre{border:1px solid #adb5bd}thead{display:table-header-group}h2,h3,p{orphans:3;widows:3}h2,h3{page-break-after:avoid}@page{size:a3}.container,body{min-width:992px!important}.navbar{display:none}.badge{border:1px solid #000}.table{border-collapse:collapse!important}.table td,.table th{background-color:#fff!important}.table-bordered td,.table-bordered th{border:1px solid #dee2e6!important}.table-dark{color:inherit}.table-dark tbody+tbody,.table-dark td,.table-dark th,.table-dark thead th{border-color:#dee2e6}.table .thead-dark th{color:inherit;border-color:#dee2e6}}.bottom-panel-header-content,.header-item,.package-header-filename{white-space:nowrap}body{font-size:14px}a,a:active,a:focus,a:hover,a:visited,input:focus{outline:0}p{margin-top:1rem}label{margin-bottom:0}ol,ul{list-style:none;padding:0}li{list-style:none}.documentation{margin-top:10px}.documentation li{list-style:disc}.documentation ol,.documentation ul{padding-left:15px}.header,.package-header{padding:5px}.flex-container{display:flex;flex-direction:column;height:100%;width:100%}.absolute-container{position:absolute;top:0;bottom:0;left:0;right:0}.header{flex:none}.header img{float:left}.header-item{display:inline-block;margin-top:5px;font-size:1rem;margin-right:40px}@media screen and (max-width:700px){.header-item{margin-right:10px;margin-left:10px}}.content{flex:auto;position:relative;overflow:auto}.packages{flex:auto;overflow-y:auto}.packages li{margin-bottom:5px}.packages a{margin-right:5px}.package-content{flex:auto;position:relative}.package-header-input{display:inline-block;margin-right:10px}.package-modules{margin-left:10px}.module-name{font-size:.7rem}.package-search-form{max-width:500px;margin-bottom:10px;margin-top:20px}.package-header-package-name{margin-right:10px;font-size:17px}.module-search-input{max-width:500px;margin:5px}ul.modules{position:absolute;top:50px;margin:0;padding-left:15px;left:0;right:0;display:flex;flex-direction:column;flex-wrap:wrap}ul.modules li{margin-right:10px}.left-panel{position:absolute;bottom:0;top:0;left:0;width:300px}.show-left-panel-button{position:absolute;top:0;right:-20px;z-index:2;width:20px;height:20px;text-align:center;vertical-align:middle;opacity:.6;display:none}.show-left-panel-button a{text-decoration:none}.show-left-panel-button:hover{opacity:1;cursor:pointer}.hide-file-tree{position:relative;top:8px;left:3px}.hide-declarations{margin:7px}.right-panel{position:absolute;top:0;right:0;left:300px;overflow-y:auto}.file-tree-container{overflow-x:hidden;overflow-y:auto;position:absolute;bottom:0;top:0;left:0;right:0}.bottom-panel,.bottom-panel-content,.file-container{position:absolute;right:0;left:0;overflow-x:auto;overflow-y:auto;bottom:0}.file-container{top:0}.bottom-panel{display:none;z-index:4}.bottom-panel-header{position:absolute;top:0;right:0;left:0;height:35px;padding:5px}.bottom-panel-content{top:35px}.bottom-panel-header-options{float:right}.source-code,code,pre{white-space:pre;line-height:1.25}.highlighted-identifier{border-radius:3px;box-shadow:0 0 0 1px #B4B4B4}td.line-number{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;width:1%;min-width:60px;text-align:left;padding-left:10px;opacity:.8}td.line-number:hover{opacity:1}td.line-content{padding-left:5px}.source-code{font-family:Consolas,Menlo,Monaco,Lucida Console,Liberation Mono,DejaVu Sans Mono,Bitstream Vera Sans Mono,Courier New,monospace,serif;tab-size:4}.break-word{word-wrap:break-word}code,pre{font-family:Consolas,Menlo,Monaco,Lucida Console,Liberation Mono,DejaVu Sans Mono,Bitstream Vera Sans Mono,Courier New,monospace,serif!important;font-size:100%;color:unset}.source-code-font{font-family:Consolas,Menlo,Monaco,Lucida Console,Liberation Mono,DejaVu Sans Mono,Bitstream Vera Sans Mono,Courier New,monospace,serif;line-height:1.25}.source-code-snippet{padding:4px;text-decoration:none!important;display:block}.autocomplete-item,.search-result,.search-results-header{padding:5px}.source-code-snippet>b{border-radius:3px;border:1px solid #B4B4B4;margin:-1px}.declarations div,.source-code-container{margin:5px}.source-code-snippet:hover{text-decoration:none}.declarations{position:fixed;top:150px;right:15px;width:450px;z-index:1}.declarations-content,.file-tree-content,.file-tree-header,.paginated-list-content,.paginated-list-header,.search-results-content,.search-results-header{position:absolute;left:0;right:0}.declarations-header{opacity:.9;height:50px}.declarations-content{opacity:.9;top:50px;max-height:500px;overflow-y:auto;overflow-x:hidden}@media screen and (max-width:1500px){.declarations{display:none}}.info-window-container{position:absolute;width:750px;z-index:10}.info-window-header{margin:5px;width:100%;cursor:move;cursor:grab;cursor:-moz-grab;cursor:-webkit-grab}.info-window-content{max-height:200px;overflow-x:auto;overflow-y:auto}.info-window-options{margin-right:10px;margin-left:10px;float:right}.ui-draggable-dragging .info-window-header{cursor:grabbing;cursor:-moz-grabbing;cursor:-webkit-grabbing}span.link{cursor:pointer;white-space:nowrap}span.link:hover{text-decoration:underline}.ui-resizable-n{height:13px!important}.ui-resizable-w{width:13px!important}.type-info{padding-top:5px;padding-bottom:5px}.type-component{display:inline-block}dd{margin-left:1em}.autocomplete-container{position:absolute;z-index:10;display:none;left:0}ul.autocomplete-items li{cursor:pointer;max-height:200px;overflow:hidden}.file-tree-header{top:0;height:50px;margin:5px}.file-tree-content{top:50px;bottom:0;overflow-x:auto}button{color:#000}.paginated-list-header{top:0;height:40px;padding:5px;white-space:nowrap}.paginated-list-content{top:40px;bottom:0;overflow:auto}.pagination-button{font-size:10px}.search-results-header{top:0;height:35px;white-space:nowrap}.search-results-content{top:35px;bottom:0}.expression{margin-bottom:15px}.expressions,.identifier-info{margin:5px}.file-name{margin-left:5px}.identifier-module{margin-top:10px}.identifier-menu-item{margin-right:10px} \ No newline at end of file diff --git a/javascript/release/assets/haskell.ico b/javascript/release/assets/haskell.ico new file mode 100644 index 0000000..37816fd Binary files /dev/null and b/javascript/release/assets/haskell.ico differ diff --git a/javascript/release/assets/throbber-62be6ed2b189444b472b8000dc187240.gif b/javascript/release/assets/throbber-62be6ed2b189444b472b8000dc187240.gif new file mode 100644 index 0000000..cd75035 Binary files /dev/null and b/javascript/release/assets/throbber-62be6ed2b189444b472b8000dc187240.gif differ diff --git a/javascript/release/assets/vendor-1da6cdb46c95e61ce73ee429881d2b12.js b/javascript/release/assets/vendor-1da6cdb46c95e61ce73ee429881d2b12.js new file mode 100644 index 0000000..a33be0e --- /dev/null +++ b/javascript/release/assets/vendor-1da6cdb46c95e61ce73ee429881d2b12.js @@ -0,0 +1,5057 @@ +function createDeprecatedModule(e){define(e,["exports","ember-resolver/resolver","ember"],function(t,n,r){r.default.deprecate("Usage of `"+e+"` module is deprecated, please update to `ember-resolver`.",!1,{id:"ember-resolver.legacy-shims",until:"3.0.0"}),t.default=n.default})}window.EmberENV={FEATURES:{},EXTEND_PROTOTYPES:{Date:!1}} +var runningTests=!1,loader,define,requireModule,require,requirejs;(function(e){"use strict" +function t(){var e=Object.create(null) +return e.__=void 0,delete e.__,e}function n(e){throw new Error("an unsupported module was defined, expected `define(id, deps, module)` instead got: `"+e+"` arguments to define`")}function r(e,t,n,r){this.uuid=p++,this.id=e,this.deps=!t.length&&n.length?f:t,this.module={exports:{}},this.callback=n,this.hasExportsAsDep=!1,this.isAlias=r,this.reified=new Array(t.length),this.state="new"}function i(){}function o(e){this.id=e}function s(e,t){throw new Error("Could not find module `"+e+"` imported from `"+t+"`")}function a(e,t,n){for(var r=h[e]||h[e+"/index"];r&&r.isAlias;)r=h[r.id]||h[r.id+"/index"] +return r||s(e,t),n&&"pending"!==r.state&&"finalized"!==r.state&&(r.findDeps(n),n.push(r)),r}function u(e,t){if("."!==e.charAt(0))return e +for(var n=e.split("/"),r=t.split("/"),i=r.slice(0,-1),o=0,s=n.length;o=0;r--)t[r].exports() +return n.module.exports},loader={noConflict:function(t){var n,r +for(n in t)t.hasOwnProperty(n)&&l.hasOwnProperty(n)&&(r=t[n],e[r]=e[n],e[n]=l[n])},makeDefaultExport:!0} +var h=t(),d=t(),p=0,f=["require","exports","module"] +r.prototype.makeDefaultExport=function(){var e=this.module.exports +null===e||"object"!=typeof e&&"function"!=typeof e||void 0!==e.default||!Object.isExtensible(e)||(e.default=e)},r.prototype.exports=function(){if("finalized"===this.state||"reifying"===this.state)return this.module.exports +loader.wrapModules&&(this.callback=loader.wrapModules(this.id,this.callback)),this.reify() +var e=this.callback.apply(this,this.reified) +return this.reified.length=0,this.state="finalized",this.hasExportsAsDep&&void 0===e||(this.module.exports=e),loader.makeDefaultExport&&this.makeDefaultExport(),this.module.exports},r.prototype.unsee=function(){this.state="new",this.module={exports:{}}},r.prototype.reify=function(){if("reified"!==this.state){this.state="reifying" +try{this.reified=this._reify(),this.state="reified"}finally{"reifying"===this.state&&(this.state="errored")}}},r.prototype._reify=function(){for(var e=this.reified.slice(),t=0;t2?arguments[2]:void 0,l=Math.min((void 0===c?s:i(c,s))-u,s-a),h=1 +for(u0;)u in n?n[a]=n[u]:delete n[a],a+=h,u+=h +return n}},{114:114,118:118,119:119}],9:[function(e,t,n){"use strict" +var r=e(119),i=e(114),o=e(118) +t.exports=function(e){for(var t=r(this),n=o(t.length),s=arguments.length,a=i(s>1?arguments[1]:void 0,n),u=s>2?arguments[2]:void 0,c=void 0===u?n:i(u,n);c>a;)t[a++]=e +return t}},{114:114,118:118,119:119}],10:[function(e,t,n){var r=e(39) +t.exports=function(e,t){var n=[] +return r(e,!1,n.push,n,t),n}},{39:39}],11:[function(e,t,n){var r=e(117),i=e(118),o=e(114) +t.exports=function(e){return function(t,n,s){var a,u=r(t),c=i(u.length),l=o(s,c) +if(e&&n!=n){for(;c>l;)if((a=u[l++])!=a)return!0}else for(;c>l;l++)if((e||l in u)&&u[l]===n)return e||l||0 +return!e&&-1}}},{114:114,117:117,118:118}],12:[function(e,t,n){var r=e(25),i=e(47),o=e(119),s=e(118),a=e(15) +t.exports=function(e,t){var n=1==e,u=2==e,c=3==e,l=4==e,h=6==e,d=5==e||h,p=t||a +return function(t,a,f){for(var g,m,v=o(t),y=i(v),b=r(a,f,3),C=s(y.length),A=0,_=n?p(t,C):u?p(t,0):void 0;C>A;A++)if((d||A in y)&&(g=y[A],m=b(g,A,v),e))if(n)_[A]=m +else if(m)switch(e){case 3:return!0 +case 5:return g +case 6:return A +case 2:_.push(g)}else if(l)return!1 +return h?-1:c||l?l:_}}},{118:118,119:119,15:15,25:25,47:47}],13:[function(e,t,n){var r=e(3),i=e(119),o=e(47),s=e(118) +t.exports=function(e,t,n,a,u){r(t) +var c=i(e),l=o(c),h=s(c.length),d=u?h-1:0,p=u?-1:1 +if(n<2)for(;;){if(d in l){a=l[d],d+=p +break}if(d+=p,u?d<0:h<=d)throw TypeError("Reduce of empty array with no initial value")}for(;u?d>=0:h>d;d+=p)d in l&&(a=t(a,l[d],d,c)) +return a}},{118:118,119:119,3:3,47:47}],14:[function(e,t,n){var r=e(51),i=e(49),o=e(128)("species") +t.exports=function(e){var t +return i(e)&&(t=e.constructor,"function"!=typeof t||t!==Array&&!i(t.prototype)||(t=void 0),r(t)&&null===(t=t[o])&&(t=void 0)),void 0===t?Array:t}},{128:128,49:49,51:51}],15:[function(e,t,n){var r=e(14) +t.exports=function(e,t){return new(r(e))(t)}},{14:14}],16:[function(e,t,n){"use strict" +var r=e(3),i=e(51),o=e(46),s=[].slice,a={},u=function(e,t,n){if(!(t in a)){for(var r=[],i=0;i1?arguments[1]:void 0,3);n=n?n.n:this._f;)for(r(n.v,n.k,this);n&&n.r;)n=n.p},has:function(e){return!!m(f(this,t),e)}}),d&&r(l.prototype,"size",{get:function(){return f(this,t)[g]}}),l},def:function(e,t,n){var r,i,o=m(e,t) +return o?o.v=n:(e._l=o={i:i=p(t,!0),k:t,v:n,p:r=e._l,n:void 0,r:!1},e._f||(e._f=o),r&&(r.n=o),e[g]++,"F"!==i&&(e._i[i]=o)),e},getEntry:m,setStrong:function(e,t,n){c(e,t,function(e,n){this._t=f(e,t),this._k=n,this._l=void 0},function(){for(var e=this,t=e._k,n=e._l;n&&n.r;)n=n.p +return e._t&&(e._l=n=n?n.n:e._t._f)?"keys"==t?l(0,n.k):"values"==t?l(0,n.v):l(0,[n.k,n.v]):(e._t=void 0,l(1))},n?"entries":"values",!n,!0),h(t)}}},{100:100,125:125,25:25,29:29,39:39,55:55,57:57,6:6,66:66,71:71,72:72,93:93}],20:[function(e,t,n){var r=e(17),i=e(10) +t.exports=function(e){return function(){if(r(this)!=e)throw TypeError(e+"#toJSON isn't generic") +return i(this)}}},{10:10,17:17}],21:[function(e,t,n){"use strict" +var r=e(93),i=e(66).getWeak,o=e(7),s=e(51),a=e(6),u=e(39),c=e(12),l=e(41),h=e(125),d=c(5),p=c(6),f=0,g=function(e){return e._l||(e._l=new m)},m=function(){this.a=[]},v=function(e,t){return d(e.a,function(e){return e[0]===t})} +m.prototype={get:function(e){var t=v(this,e) +if(t)return t[1]},has:function(e){return!!v(this,e)},set:function(e,t){var n=v(this,e) +n?n[1]=t:this.a.push([e,t])},delete:function(e){var t=p(this.a,function(t){return t[0]===e}) +return~t&&this.a.splice(t,1),!!~t}},t.exports={getConstructor:function(e,t,n,o){var c=e(function(e,r){a(e,c,t,"_i"),e._t=t,e._i=f++,e._l=void 0,void 0!=r&&u(r,n,e[o],e)}) +return r(c.prototype,{delete:function(e){if(!s(e))return!1 +var n=i(e) +return!0===n?g(h(this,t)).delete(e):n&&l(n,this._i)&&delete n[this._i]},has:function(e){if(!s(e))return!1 +var n=i(e) +return!0===n?g(h(this,t)).has(e):n&&l(n,this._i)}}),c},def:function(e,t,n){var r=i(o(t),!0) +return!0===r?g(e).set(t,n):r[e._i]=n,e},ufstore:g}},{12:12,125:125,39:39,41:41,51:51,6:6,66:66,7:7,93:93}],22:[function(e,t,n){"use strict" +var r=e(40),i=e(33),o=e(94),s=e(93),a=e(66),u=e(39),c=e(6),l=e(51),h=e(35),d=e(56),p=e(101),f=e(45) +t.exports=function(e,t,n,g,m,v){var y=r[e],b=y,C=m?"set":"add",A=b&&b.prototype,_={},I=function(e){var t=A[e] +o(A,e,"delete"==e?function(e){return!(v&&!l(e))&&t.call(this,0===e?0:e)}:"has"==e?function(e){return!(v&&!l(e))&&t.call(this,0===e?0:e)}:"get"==e?function(e){return v&&!l(e)?void 0:t.call(this,0===e?0:e)}:"add"==e?function(e){return t.call(this,0===e?0:e),this}:function(e,n){return t.call(this,0===e?0:e,n),this})} +if("function"==typeof b&&(v||A.forEach&&!h(function(){(new b).entries().next()}))){var w=new b,x=w[C](v?{}:-0,1)!=w,k=h(function(){w.has(1)}),j=d(function(e){new b(e)}),E=!v&&h(function(){for(var e=new b,t=5;t--;)e[C](t,t) +return!e.has(-0)}) +j||(b=t(function(t,n){c(t,b,e) +var r=f(new y,t,b) +return void 0!=n&&u(n,m,r[C],r),r}),b.prototype=A,A.constructor=b),(k||E)&&(I("delete"),I("has"),m&&I("get")),(E||x)&&I(C),v&&A.clear&&delete A.clear}else b=g.getConstructor(t,e,m,C),s(b.prototype,n),a.NEED=!0 +return p(b,e),_[e]=b,i(i.G+i.W+i.F*(b!=y),_),v||g.setStrong(b,e,m),b}},{101:101,33:33,35:35,39:39,40:40,45:45,51:51,56:56,6:6,66:66,93:93,94:94}],23:[function(e,t,n){var r=t.exports={version:"2.5.0"} +"number"==typeof __e&&(__e=r)},{}],24:[function(e,t,n){"use strict" +var r=e(72),i=e(92) +t.exports=function(e,t,n){t in e?r.f(e,t,i(0,n)):e[t]=n}},{72:72,92:92}],25:[function(e,t,n){var r=e(3) +t.exports=function(e,t,n){if(r(e),void 0===t)return e +switch(n){case 1:return function(n){return e.call(t,n)} +case 2:return function(n,r){return e.call(t,n,r)} +case 3:return function(n,r,i){return e.call(t,n,r,i)}}return function(){return e.apply(t,arguments)}}},{3:3}],26:[function(e,t,n){"use strict" +var r=e(35),i=Date.prototype.getTime,o=Date.prototype.toISOString,s=function(e){return e>9?e:"0"+e} +t.exports=r(function(){return"0385-07-25T07:06:39.999Z"!=o.call(new Date(-5e13-1))})||!r(function(){o.call(new Date(NaN))})?function(){if(!isFinite(i.call(this)))throw RangeError("Invalid time value") +var e=this,t=e.getUTCFullYear(),n=e.getUTCMilliseconds(),r=t<0?"-":t>9999?"+":"" +return r+("00000"+Math.abs(t)).slice(r?-6:-4)+"-"+s(e.getUTCMonth()+1)+"-"+s(e.getUTCDate())+"T"+s(e.getUTCHours())+":"+s(e.getUTCMinutes())+":"+s(e.getUTCSeconds())+"."+(n>99?n:"0"+s(n))+"Z"}:o},{35:35}],27:[function(e,t,n){"use strict" +var r=e(7),i=e(120) +t.exports=function(e){if("string"!==e&&"number"!==e&&"default"!==e)throw TypeError("Incorrect hint") +return i(r(this),"number"!=e)}},{120:120,7:7}],28:[function(e,t,n){t.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e) +return e}},{}],29:[function(e,t,n){t.exports=!e(35)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},{35:35}],30:[function(e,t,n){var r=e(51),i=e(40).document,o=r(i)&&r(i.createElement) +t.exports=function(e){return o?i.createElement(e):{}}},{40:40,51:51}],31:[function(e,t,n){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},{}],32:[function(e,t,n){var r=e(81),i=e(78),o=e(82) +t.exports=function(e){var t=r(e),n=i.f +if(n)for(var s,a=n(e),u=o.f,c=0;a.length>c;)u.call(e,s=a[c++])&&t.push(s) +return t}},{78:78,81:81,82:82}],33:[function(e,t,n){var r=e(40),i=e(23),o=e(42),s=e(94),a=e(25),u=function(e,t,n){var c,l,h,d,p=e&u.F,f=e&u.G,g=e&u.S,m=e&u.P,v=e&u.B,y=f?r:g?r[t]||(r[t]={}):(r[t]||{}).prototype,b=f?i:i[t]||(i[t]={}),C=b.prototype||(b.prototype={}) +f&&(n=t) +for(c in n)l=!p&&y&&void 0!==y[c],h=(l?y:n)[c],d=v&&l?a(h,r):m&&"function"==typeof h?a(Function.call,h):h,y&&s(y,c,h,e&u.U),b[c]!=h&&o(b,c,d),m&&C[c]!=h&&(C[c]=h)} +r.core=i,u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,t.exports=u},{23:23,25:25,40:40,42:42,94:94}],34:[function(e,t,n){var r=e(128)("match") +t.exports=function(e){var t=/./ +try{"/./"[e](t)}catch(n){try{return t[r]=!1,!"/./"[e](t)}catch(e){}}return!0}},{128:128}],35:[function(e,t,n){t.exports=function(e){try{return!!e()}catch(e){return!0}}},{}],36:[function(e,t,n){"use strict" +var r=e(42),i=e(94),o=e(35),s=e(28),a=e(128) +t.exports=function(e,t,n){var u=a(e),c=n(s,u,""[e]),l=c[0],h=c[1] +o(function(){var t={} +return t[u]=function(){return 7},7!=""[e](t)})&&(i(String.prototype,e,l),r(RegExp.prototype,u,2==t?function(e,t){return h.call(e,this,t)}:function(e){return h.call(e,this)}))}},{128:128,28:28,35:35,42:42,94:94}],37:[function(e,t,n){"use strict" +var r=e(7) +t.exports=function(){var e=r(this),t="" +return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t}},{7:7}],38:[function(e,t,n){"use strict" +function r(e,t,n,c,l,h,d,p){for(var f,g,m=l,v=0,y=!!d&&a(d,p,3);v0)m=r(e,t,f,s(f.length),m,h-1)-1 +else{if(m>=9007199254740991)throw TypeError() +e[m]=f}m++}v++}return m}var i=e(49),o=e(51),s=e(118),a=e(25),u=e(128)("isConcatSpreadable") +t.exports=r},{118:118,128:128,25:25,49:49,51:51}],39:[function(e,t,n){var r=e(25),i=e(53),o=e(48),s=e(7),a=e(118),u=e(129),c={},l={},n=t.exports=function(e,t,n,h,d){var p,f,g,m,v=d?function(){return e}:u(e),y=r(n,h,t?2:1),b=0 +if("function"!=typeof v)throw TypeError(e+" is not iterable!") +if(o(v)){for(p=a(e.length);p>b;b++)if((m=t?y(s(f=e[b])[0],f[1]):y(e[b]))===c||m===l)return m}else for(g=v.call(e);!(f=g.next()).done;)if((m=i(g,y,f.value,t))===c||m===l)return m} +n.BREAK=c,n.RETURN=l},{118:118,129:129,25:25,48:48,53:53,7:7}],40:[function(e,t,n){var r=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")() +"number"==typeof __g&&(__g=r)},{}],41:[function(e,t,n){var r={}.hasOwnProperty +t.exports=function(e,t){return r.call(e,t)}},{}],42:[function(e,t,n){var r=e(72),i=e(92) +t.exports=e(29)?function(e,t,n){return r.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}},{29:29,72:72,92:92}],43:[function(e,t,n){var r=e(40).document +t.exports=r&&r.documentElement},{40:40}],44:[function(e,t,n){t.exports=!e(29)&&!e(35)(function(){return 7!=Object.defineProperty(e(30)("div"),"a",{get:function(){return 7}}).a})},{29:29,30:30,35:35}],45:[function(e,t,n){var r=e(51),i=e(99).set +t.exports=function(e,t,n){var o,s=t.constructor +return s!==n&&"function"==typeof s&&(o=s.prototype)!==n.prototype&&r(o)&&i&&i(e,o),e}},{51:51,99:99}],46:[function(e,t,n){t.exports=function(e,t,n){var r=void 0===n +switch(t.length){case 0:return r?e():e.call(n) +case 1:return r?e(t[0]):e.call(n,t[0]) +case 2:return r?e(t[0],t[1]):e.call(n,t[0],t[1]) +case 3:return r?e(t[0],t[1],t[2]):e.call(n,t[0],t[1],t[2]) +case 4:return r?e(t[0],t[1],t[2],t[3]):e.call(n,t[0],t[1],t[2],t[3])}return e.apply(n,t)}},{}],47:[function(e,t,n){var r=e(18) +t.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==r(e)?e.split(""):Object(e)}},{18:18}],48:[function(e,t,n){var r=e(58),i=e(128)("iterator"),o=Array.prototype +t.exports=function(e){return void 0!==e&&(r.Array===e||o[i]===e)}},{128:128,58:58}],49:[function(e,t,n){var r=e(18) +t.exports=Array.isArray||function(e){return"Array"==r(e)}},{18:18}],50:[function(e,t,n){var r=e(51),i=Math.floor +t.exports=function(e){return!r(e)&&isFinite(e)&&i(e)===e}},{51:51}],51:[function(e,t,n){t.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},{}],52:[function(e,t,n){var r=e(51),i=e(18),o=e(128)("match") +t.exports=function(e){var t +return r(e)&&(void 0!==(t=e[o])?!!t:"RegExp"==i(e))}},{128:128,18:18,51:51}],53:[function(e,t,n){var r=e(7) +t.exports=function(e,t,n,i){try{return i?t(r(n)[0],n[1]):t(n)}catch(t){var o=e.return +throw void 0!==o&&r(o.call(e)),t}}},{7:7}],54:[function(e,t,n){"use strict" +var r=e(71),i=e(92),o=e(101),s={} +e(42)(s,e(128)("iterator"),function(){return this}),t.exports=function(e,t,n){e.prototype=r(s,{next:i(1,n)}),o(e,t+" Iterator")}},{101:101,128:128,42:42,71:71,92:92}],55:[function(e,t,n){"use strict" +var r=e(60),i=e(33),o=e(94),s=e(42),a=e(41),u=e(58),c=e(54),l=e(101),h=e(79),d=e(128)("iterator"),p=!([].keys&&"next"in[].keys()),f=function(){return this} +t.exports=function(e,t,n,g,m,v,y){c(n,t,g) +var b,C,A,_=function(e){if(!p&&e in k)return k[e] +switch(e){case"keys":case"values":return function(){return new n(this,e)}}return function(){return new n(this,e)}},I=t+" Iterator",w="values"==m,x=!1,k=e.prototype,j=k[d]||k["@@iterator"]||m&&k[m],E=j||_(m),S=m?w?_("entries"):E:void 0,T="Array"==t?k.entries||j:j +if(T&&(A=h(T.call(new e)))!==Object.prototype&&A.next&&(l(A,I,!0),r||a(A,d)||s(A,d,f)),w&&j&&"values"!==j.name&&(x=!0,E=function(){return j.call(this)}),r&&!y||!p&&!x&&k[d]||s(k,d,E),u[t]=E,u[I]=f,m)if(b={values:w?E:_("values"),keys:v?E:_("keys"),entries:S},y)for(C in b)C in k||o(k,C,b[C]) +else i(i.P+i.F*(p||x),t,b) +return b}},{101:101,128:128,33:33,41:41,42:42,54:54,58:58,60:60,79:79,94:94}],56:[function(e,t,n){var r=e(128)("iterator"),i=!1 +try{var o=[7][r]() +o.return=function(){i=!0},Array.from(o,function(){throw 2})}catch(e){}t.exports=function(e,t){if(!t&&!i)return!1 +var n=!1 +try{var o=[7],s=o[r]() +s.next=function(){return{done:n=!0}},o[r]=function(){return s},e(o)}catch(e){}return n}},{128:128}],57:[function(e,t,n){t.exports=function(e,t){return{value:t,done:!!e}}},{}],58:[function(e,t,n){t.exports={}},{}],59:[function(e,t,n){var r=e(81),i=e(117) +t.exports=function(e,t){for(var n,o=i(e),s=r(o),a=s.length,u=0;a>u;)if(o[n=s[u++]]===t)return n}},{117:117,81:81}],60:[function(e,t,n){t.exports=!1},{}],61:[function(e,t,n){var r=Math.expm1 +t.exports=!r||r(10)>22025.465794806718||r(10)<22025.465794806718||-2e-17!=r(-2e-17)?function(e){return 0==(e=+e)?e:e>-1e-6&&e<1e-6?e+e*e/2:Math.exp(e)-1}:r},{}],62:[function(e,t,n){var r=e(65),i=Math.pow,o=i(2,-52),s=i(2,-23),a=i(2,127)*(2-s),u=i(2,-126),c=function(e){return e+1/o-1/o} +t.exports=Math.fround||function(e){var t,n,i=Math.abs(e),l=r(e) +return ia||n!=n?l*(1/0):l*n)}},{65:65}],63:[function(e,t,n){t.exports=Math.log1p||function(e){return(e=+e)>-1e-8&&e<1e-8?e-e*e/2:Math.log(1+e)}},{}],64:[function(e,t,n){t.exports=Math.scale||function(e,t,n,r,i){return 0===arguments.length||e!=e||t!=t||n!=n||r!=r||i!=i?NaN:e===1/0||e===-1/0?e:(e-t)*(i-r)/(n-t)+r}},{}],65:[function(e,t,n){t.exports=Math.sign||function(e){return 0==(e=+e)||e!=e?e:e<0?-1:1}},{}],66:[function(e,t,n){var r=e(124)("meta"),i=e(51),o=e(41),s=e(72).f,a=0,u=Object.isExtensible||function(){return!0},c=!e(35)(function(){return u(Object.preventExtensions({}))}),l=function(e){s(e,r,{value:{i:"O"+ ++a,w:{}}})},h=function(e,t){if(!i(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e +if(!o(e,r)){if(!u(e))return"F" +if(!t)return"E" +l(e)}return e[r].i},d=function(e,t){if(!o(e,r)){if(!u(e))return!0 +if(!t)return!1 +l(e)}return e[r].w},p=function(e){return c&&f.NEED&&u(e)&&!o(e,r)&&l(e),e},f=t.exports={KEY:r,NEED:!1,fastKey:h,getWeak:d,onFreeze:p}},{124:124,35:35,41:41,51:51,72:72}],67:[function(e,t,n){var r=e(160),i=e(33),o=e(103)("metadata"),s=o.store||(o.store=new(e(266))),a=function(e,t,n){var i=s.get(e) +if(!i){if(!n)return +s.set(e,i=new r)}var o=i.get(t) +if(!o){if(!n)return +i.set(t,o=new r)}return o},u=function(e,t,n){var r=a(t,n,!1) +return void 0!==r&&r.has(e)},c=function(e,t,n){var r=a(t,n,!1) +return void 0===r?void 0:r.get(e)},l=function(e,t,n,r){a(n,r,!0).set(e,t)},h=function(e,t){var n=a(e,t,!1),r=[] +return n&&n.forEach(function(e,t){r.push(t)}),r},d=function(e){return void 0===e||"symbol"==typeof e?e:String(e)},p=function(e){i(i.S,"Reflect",e)} +t.exports={store:s,map:a,has:u,get:c,set:l,keys:h,key:d,exp:p}},{103:103,160:160,266:266,33:33}],68:[function(e,t,n){var r=e(40),i=e(113).set,o=r.MutationObserver||r.WebKitMutationObserver,s=r.process,a=r.Promise,u="process"==e(18)(s) +t.exports=function(){var e,t,n,c=function(){var r,i +for(u&&(r=s.domain)&&r.exit();e;){i=e.fn,e=e.next +try{i()}catch(r){throw e?n():t=void 0,r}}t=void 0,r&&r.enter()} +if(u)n=function(){s.nextTick(c)} +else if(o){var l=!0,h=document.createTextNode("") +new o(c).observe(h,{characterData:!0}),n=function(){h.data=l=!l}}else if(a&&a.resolve){var d=a.resolve() +n=function(){d.then(c)}}else n=function(){i.call(r,c)} +return function(r){var i={fn:r,next:void 0} +t&&(t.next=i),e||(e=i,n()),t=i}}},{113:113,18:18,40:40}],69:[function(e,t,n){"use strict" +function r(e){var t,n +this.promise=new e(function(e,r){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor") +t=e,n=r}),this.resolve=i(t),this.reject=i(n)}var i=e(3) +t.exports.f=function(e){return new r(e)}},{3:3}],70:[function(e,t,n){"use strict" +var r=e(81),i=e(78),o=e(82),s=e(119),a=e(47),u=Object.assign +t.exports=!u||e(35)(function(){var e={},t={},n=Symbol(),r="abcdefghijklmnopqrst" +return e[n]=7,r.split("").forEach(function(e){t[e]=e}),7!=u({},e)[n]||Object.keys(u({},t)).join("")!=r})?function(e,t){for(var n=s(e),u=arguments.length,c=1,l=i.f,h=o.f;u>c;)for(var d,p=a(arguments[c++]),f=l?r(p).concat(l(p)):r(p),g=f.length,m=0;g>m;)h.call(p,d=f[m++])&&(n[d]=p[d]) +return n}:u},{119:119,35:35,47:47,78:78,81:81,82:82}],71:[function(e,t,n){var r=e(7),i=e(73),o=e(31),s=e(102)("IE_PROTO"),a=function(){},u=function(){var t,n=e(30)("iframe"),r=o.length +for(n.style.display="none",e(43).appendChild(n),n.src="javascript:",t=n.contentWindow.document,t.open(),t.write(" + + + + + + + + + + + + diff --git a/javascript/release/robots.txt b/javascript/release/robots.txt new file mode 100644 index 0000000..f591645 --- /dev/null +++ b/javascript/release/robots.txt @@ -0,0 +1,3 @@ +# http://www.robotstxt.org +User-agent: * +Disallow: diff --git a/javascript/server/.eslintrc.js b/javascript/server/.eslintrc.js new file mode 100644 index 0000000..1147d29 --- /dev/null +++ b/javascript/server/.eslintrc.js @@ -0,0 +1,5 @@ +module.exports = { + env: { + node: true + } +}; diff --git a/javascript/server/index.js b/javascript/server/index.js new file mode 100644 index 0000000..eadf932 --- /dev/null +++ b/javascript/server/index.js @@ -0,0 +1,30 @@ +/* eslint-env node */ +'use strict'; + +//https://discuss.emberjs.com/t/how-to-disable-http-mock-server-within-environment-config-file/6660/9 + +//To use http mocks from server/mocks for testing: +//ember server +//To use real server: +//ember server --proxy=http://localhost:8080/ + +function usingProxy() { + return !!process.argv.filter(function (arg) { + return arg.indexOf('--proxy') === 0; + }).length; +} + +module.exports = function(app) { + if (usingProxy()) { return; } + + const globSync = require('glob').sync; + const mocks = globSync('./mocks/**/*.js', { cwd: __dirname }).map(require); + const proxies = globSync('./proxies/**/*.js', { cwd: __dirname }).map(require); + + // Log proxy requests + const morgan = require('morgan'); + app.use(morgan('dev')); + + mocks.forEach(route => route(app)); + proxies.forEach(route => route(app)); +}; diff --git a/javascript/server/mocks/packages.js b/javascript/server/mocks/packages.js new file mode 100644 index 0000000..5da80b2 --- /dev/null +++ b/javascript/server/mocks/packages.js @@ -0,0 +1,397 @@ +/* eslint-env node */ +'use strict'; + +const packages = [ + { + "versions": [ + "0.1.0.0" + ], + "name": "test-package" + } +]; + +const testPackage = { + "directoryTree": { + "tag": "Dir", + "contents": [ + { + "tag": "File", + "path": "Setup.hs", + "isHaskellModule": false, + "name": "Setup.hs" + }, + { + "tag": "File", + "path": "stack-8.0.2.yaml", + "isHaskellModule": false, + "name": "stack-8.0.2.yaml" + }, + { + "tag": "File", + "path": "stack.yaml", + "isHaskellModule": false, + "name": "stack.yaml" + }, + { + "tag": "Dir", + "contents": [ + { + "tag": "File", + "path": "src/Lib.hs", + "isHaskellModule": true, + "name": "Lib.hs" + }, + { + "tag": "File", + "path": "src/Types.hs", + "isHaskellModule": true, + "name": "Types.hs" + } + ], + "name": "src" + }, + { + "tag": "Dir", + "contents": [ + { + "tag": "File", + "path": "app/Main.hs", + "isHaskellModule": true, + "name": "Main.hs" + } + ], + "name": "app" + }, + { + "tag": "Dir", + "contents": [ + { + "tag": "File", + "path": "test/Spec.hs", + "isHaskellModule": true, + "name": "Spec.hs" + } + ], + "name": "test" + }, + { + "tag": "File", + "path": "package.yaml", + "isHaskellModule": false, + "name": "package.yaml" + }, + { + "tag": "File", + "path": "test-package.cabal", + "isHaskellModule": false, + "name": "test-package.cabal" + } + ], + "name": "test-package" + }, + "modules": { + "app/Main.hs": [], + "src/Types.hs": [], + "test/Spec.hs": [], + "src/Lib.hs": [] + }, + "id": "test-package-0.1.0.0" +}; + +const testModuleInfo = { + "occurrences": { + "3-8-11": { + "sort": { + "tag": "ModuleId", + "contents": { + "packageId": { + "name": "test-package", + "version": "0.1.0.0" + }, + "tag": "ApproximateLocation", + "moduleName": "Lib", + "name": "Lib", + "componentId": "exe-test-package-exe", + "entity": "Mod" + } + }, + "description": "ImportDecl" + }, + "6-8-16": { + "internalId": "4", + "sort": { + "tag": "ValueId" + }, + "description": "HsVar" + }, + "5-1-5": { + "internalId": "0", + "sort": { + "tag": "ValueId" + }, + "description": "TypeSig" + }, + "5-9-11": { + "internalId": "2", + "sort": { + "tag": "TypeId" + }, + "description": "HsTyVar" + }, + "6-1-5": { + "isBinder": true, + "internalId": "0", + "sort": { + "tag": "ValueId" + }, + "description": "Match" + }, + "5-12-14": { + "internalId": "3", + "sort": { + "tag": "TypeId" + }, + "description": "HsTupleTy" + } + }, + "identifiers": { + "7": { + "isExported": false, + "idType": { + "components": [ + { + "tag": "TyCon", + "name": "RuntimeRep", + "internalId": "6" + } + ] + }, + "locationInfo": { + "packageId": { + "name": "ghc-prim", + "version": "0.5.1.1" + }, + "tag": "ApproximateLocation", + "haddockAnchorId": "LiftedRep", + "moduleName": "GHC.Types", + "name": "LiftedRep", + "componentId": "lib", + "entity": "Val" + }, + "nameSpace": "DataName", + "internalId": "7", + "sort": "External", + "occName": "LiftedRep", + "externalId": "ghc-prim-0.5.1.1|GHC.Types|Val|LiftedRep", + "demangledOccName": "LiftedRep" + }, + "0": { + "isExported": true, + "idType": { + "components": [ + { + "tag": "TyCon", + "name": "IO", + "internalId": "2" + }, + { + "tag": "Text", + "contents": " ()" + } + ] + }, + "locationInfo": { + "packageId": { + "name": "test-package", + "version": "0.1.0.0" + }, + "tag": "ExactLocation", + "moduleName": "Main", + "startLine": 6, + "endLine": 6, + "modulePath": "app/Main.hs", + "startColumn": 1, + "endColumn": 5 + }, + "nameSpace": "VarName", + "internalId": "0", + "details": "VanillaId", + "sort": "External", + "occName": "main", + "externalId": "test-package-0.1.0.0|Main|Val|main", + "demangledOccName": "main" + }, + "4": { + "isExported": false, + "idType": { + "components": [ + { + "tag": "TyCon", + "name": "IO", + "internalId": "2" + }, + { + "tag": "Text", + "contents": " ()" + } + ] + }, + "doc": "

someFunc documentation

", + "locationInfo": { + "packageId": { + "name": "test-package", + "version": "0.1.0.0" + }, + "tag": "ExactLocation", + "moduleName": "Lib", + "startLine": 9, + "endLine": 9, + "modulePath": "src/Lib.hs", + "startColumn": 1, + "endColumn": 9 + }, + "nameSpace": "VarName", + "internalId": "4", + "details": "VanillaId", + "sort": "External", + "occName": "someFunc", + "externalId": "test-package-0.1.0.0|Lib|Val|someFunc", + "demangledOccName": "someFunc" + }, + "2": { + "isExported": false, + "idType": { + "components": [ + { + "tag": "Text", + "contents": "* -> *" + } + ] + }, + "locationInfo": { + "packageId": { + "name": "ghc-prim", + "version": "0.5.1.1" + }, + "tag": "ApproximateLocation", + "haddockAnchorId": "IO", + "moduleName": "GHC.Types", + "name": "IO", + "componentId": "lib", + "entity": "Typ" + }, + "nameSpace": "TcClsName", + "internalId": "2", + "sort": "External", + "occName": "IO", + "externalId": "ghc-prim-0.5.1.1|GHC.Types|Typ|IO", + "demangledOccName": "IO" + }, + "5": { + "isExported": false, + "idType": { + "components": [ + { + "tag": "TyCon", + "name": "RuntimeRep", + "internalId": "6" + }, + { + "tag": "Text", + "contents": " -> *" + } + ] + }, + "locationInfo": { + "packageId": { + "name": "ghc-prim", + "version": "0.5.1.1" + }, + "tag": "ApproximateLocation", + "haddockAnchorId": "TYPE", + "moduleName": "GHC.Prim", + "name": "TYPE", + "componentId": "lib", + "entity": "Typ" + }, + "nameSpace": "TcClsName", + "internalId": "5", + "sort": "External", + "occName": "TYPE", + "externalId": "ghc-prim-0.5.1.1|GHC.Prim|Typ|TYPE", + "demangledOccName": "TYPE" + }, + "3": { + "isExported": false, + "idType": { + "components": [ + { + "tag": "Text", + "contents": "*" + } + ] + }, + "locationInfo": { + "packageId": { + "name": "ghc-prim", + "version": "0.5.1.1" + }, + "tag": "ApproximateLocation", + "haddockAnchorId": "-40--41-", + "moduleName": "GHC.Tuple", + "name": "()", + "componentId": "lib", + "entity": "Typ" + }, + "nameSpace": "TcClsName", + "internalId": "3", + "sort": "External", + "occName": "()", + "externalId": "ghc-prim-0.5.1.1|GHC.Tuple|Typ|()", + "demangledOccName": "()" + } + }, + "name": "Main", + "sourceCodeHtml": "
1module Main where
2
3import Lib
4
5main :: IO ()
6main = someFunc
7
8
", + "id": "app/Main.hs", + "declarations": [ + { + "isExported": true, + "lineNumber": 6, + "declType": { + "components": [ + { + "tag": "TyCon", + "name": "IO", + "internalId": "2" + }, + { + "tag": "Text", + "contents": " ()" + } + ] + }, + "name": "main", + "sort": "ValD" + } + ] +}; + +module.exports = function(app) { + const express = require('express'); + let packagesRouter = express.Router(); + + packagesRouter.get('/api/packages', function(req, res) { + res.send(packages); + }); + + packagesRouter.get('/files/test-package-0.1.0.0/.haskell-code-explorer/packageInfo.json', function(req, res) { + res.send(testPackage); + }); + + packagesRouter.get('/files/test-package-0.1.0.0/.haskell-code-explorer/app%252FMain.hs.json', function(req, res) { + res.send(testModuleInfo); + }); + + app.use('/', packagesRouter); +}; diff --git a/javascript/testem.js b/javascript/testem.js new file mode 100644 index 0000000..d7710c2 --- /dev/null +++ b/javascript/testem.js @@ -0,0 +1,24 @@ +/* eslint-env node */ +module.exports = { + test_page: 'tests/index.html?hidepassed', + disable_watching: true, + launch_in_ci: [ + 'Chrome' + ], + launch_in_dev: [ + 'Chrome' + ], + browser_args: { + Chrome: { + mode: 'ci', + args: [ + // --no-sandbox is needed when running Chrome inside a container + process.env.TRAVIS ? '--no-sandbox' : null, + '--disable-gpu', + '--headless', + '--remote-debugging-port=0', + '--window-size=1440,900' + ].filter(Boolean) + } + } +}; diff --git a/javascript/tests/.eslintrc.js b/javascript/tests/.eslintrc.js new file mode 100644 index 0000000..fbf2555 --- /dev/null +++ b/javascript/tests/.eslintrc.js @@ -0,0 +1,5 @@ +module.exports = { + env: { + embertest: true + } +}; diff --git a/javascript/tests/acceptance/haskell-module-test.js b/javascript/tests/acceptance/haskell-module-test.js new file mode 100644 index 0000000..939c0dd --- /dev/null +++ b/javascript/tests/acceptance/haskell-module-test.js @@ -0,0 +1,28 @@ +import { module, test } from 'qunit'; +import { visit, currentURL, find } from '@ember/test-helpers'; +import { setupApplicationTest } from 'ember-qunit'; + + +module('Acceptance | haskell-module', function(hooks) { + setupApplicationTest(hooks); + + //Test data is in 'server/mocks/packages.js' + test('visiting /package/test-package-0.1.0.0/show/app/Main.hs', async function(assert) { + await visit('/package/test-package-0.1.0.0/show/app/Main.hs'); + + assert.equal(currentURL(), '/package/test-package-0.1.0.0/show/app/Main.hs'); + + const lines = Array.from(find('tbody').children).map((tr) => { + return tr.children[1].innerText; + }); + + assert.deepEqual(lines,["module Main where", + "", + "import Lib", + "", + "main :: IO ()", + "main = someFunc", + "", + ""]); + }); +}); diff --git a/javascript/tests/acceptance/package-test.js b/javascript/tests/acceptance/package-test.js new file mode 100644 index 0000000..bdb1fef --- /dev/null +++ b/javascript/tests/acceptance/package-test.js @@ -0,0 +1,23 @@ +import { module, test } from 'qunit'; +import { visit, currentURL, find } from '@ember/test-helpers'; +import { setupApplicationTest } from 'ember-qunit'; + + +module('Acceptance | package', function(hooks) { + setupApplicationTest(hooks); + + //Test data is in 'server/mocks/packages.js' + test('visiting /package/test-package-0.1.0.0', async function(assert) { + await visit('/package/test-package-0.1.0.0'); + assert.equal(currentURL(), '/package/test-package-0.1.0.0'); + + const moduleNames = Array.from(find('ul.modules').children).map((li) => { + return [li.innerText,li.children[0].getAttribute('href')]; + }); + + assert.deepEqual(moduleNames,[["app/Main.hs","/package/test-package-0.1.0.0/show/app/Main.hs"], + ["src/Lib.hs","/package/test-package-0.1.0.0/show/src/Lib.hs"], + ["src/Types.hs","/package/test-package-0.1.0.0/show/src/Types.hs"], + ["test/Spec.hs","/package/test-package-0.1.0.0/show/test/Spec.hs"]]); + }); +}); diff --git a/javascript/tests/acceptance/packages-test.js b/javascript/tests/acceptance/packages-test.js new file mode 100644 index 0000000..4c970b1 --- /dev/null +++ b/javascript/tests/acceptance/packages-test.js @@ -0,0 +1,16 @@ +import { module, test } from 'qunit'; +import { visit, currentURL, find } from '@ember/test-helpers'; +import { setupApplicationTest } from 'ember-qunit'; + +module('Acceptance | packages', function(hooks) { + setupApplicationTest(hooks); + + //Test data is in file 'server/mocks/packages.js' + test('visiting /', async function(assert) { + await visit('/'); + assert.equal(currentURL(), '/'); + const linkToPackage = find('ul a:first-child'); + assert.equal(linkToPackage.innerText, 'test-package-0.1.0.0'); + assert.equal(linkToPackage.getAttribute('href'), '/package/test-package-0.1.0.0'); + }); +}); diff --git a/javascript/tests/helpers/.gitkeep b/javascript/tests/helpers/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/javascript/tests/index.html b/javascript/tests/index.html new file mode 100644 index 0000000..19f55cc --- /dev/null +++ b/javascript/tests/index.html @@ -0,0 +1,33 @@ + + + + + + HaskellCodeExplorer Tests + + + + {{content-for "head"}} + {{content-for "test-head"}} + + + + + + {{content-for "head-footer"}} + {{content-for "test-head-footer"}} + + + {{content-for "body"}} + {{content-for "test-body"}} + + + + + + + + {{content-for "body-footer"}} + {{content-for "test-body-footer"}} + + diff --git a/javascript/tests/integration/.gitkeep b/javascript/tests/integration/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/javascript/tests/integration/components/.gitkeep b/javascript/tests/integration/components/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/javascript/tests/test-helper.js b/javascript/tests/test-helper.js new file mode 100644 index 0000000..0382a84 --- /dev/null +++ b/javascript/tests/test-helper.js @@ -0,0 +1,8 @@ +import Application from '../app'; +import config from '../config/environment'; +import { setApplication } from '@ember/test-helpers'; +import { start } from 'ember-qunit'; + +setApplication(Application.create(config.APP)); + +start(); diff --git a/javascript/vendor/.gitkeep b/javascript/vendor/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/javascript/vendor/jquery-ui-1.12.1.custom/AUTHORS.txt b/javascript/vendor/jquery-ui-1.12.1.custom/AUTHORS.txt new file mode 100644 index 0000000..a75056b --- /dev/null +++ b/javascript/vendor/jquery-ui-1.12.1.custom/AUTHORS.txt @@ -0,0 +1,333 @@ +Authors ordered by first contribution +A list of current team members is available at http://jqueryui.com/about + +Paul Bakaus +Richard Worth +Yehuda Katz +Sean Catchpole +John Resig +Tane Piper +Dmitri Gaskin +Klaus Hartl +Stefan Petre +Gilles van den Hoven +Micheil Bryan Smith +Jörn Zaefferer +Marc Grabanski +Keith Wood +Brandon Aaron +Scott González +Eduardo Lundgren +Aaron Eisenberger +Joan Piedra +Bruno Basto +Remy Sharp +Bohdan Ganicky +David Bolter +Chi Cheng +Ca-Phun Ung +Ariel Flesler +Maggie Wachs +Scott Jehl +Todd Parker +Andrew Powell +Brant Burnett +Douglas Neiner +Paul Irish +Ralph Whitbeck +Thibault Duplessis +Dominique Vincent +Jack Hsu +Adam Sontag +Carl Fürstenberg +Kevin Dalman +Alberto Fernández Capel +Jacek Jędrzejewski (http://jacek.jedrzejewski.name) +Ting Kuei +Samuel Cormier-Iijima +Jon Palmer +Ben Hollis +Justin MacCarthy +Eyal Kobrigo +Tiago Freire +Diego Tres +Holger Rüprich +Ziling Zhao +Mike Alsup +Robson Braga Araujo +Pierre-Henri Ausseil +Christopher McCulloh +Andrew Newcomb +Lim Chee Aun +Jorge Barreiro +Daniel Steigerwald +John Firebaugh +John Enters +Andrey Kapitcyn +Dmitry Petrov +Eric Hynds +Chairat Sunthornwiphat +Josh Varner +Stéphane Raimbault +Jay Merrifield +J. Ryan Stinnett +Peter Heiberg +Alex Dovenmuehle +Jamie Gegerson +Raymond Schwartz +Phillip Barnes +Kyle Wilkinson +Khaled AlHourani +Marian Rudzynski +Jean-Francois Remy +Doug Blood +Filippo Cavallarin +Heiko Henning +Aliaksandr Rahalevich +Mario Visic +Xavi Ramirez +Max Schnur +Saji Nediyanchath +Corey Frang +Aaron Peterson +Ivan Peters +Mohamed Cherif Bouchelaghem +Marcos Sousa +Michael DellaNoce +George Marshall +Tobias Brunner +Martin Solli +David Petersen +Dan Heberden +William Kevin Manire +Gilmore Davidson +Michael Wu +Adam Parod +Guillaume Gautreau +Marcel Toele +Dan Streetman +Matt Hoskins +Giovanni Giacobbi +Kyle Florence +Pavol Hluchý +Hans Hillen +Mark Johnson +Trey Hunner +Shane Whittet +Edward A Faulkner +Adam Baratz +Kato Kazuyoshi +Eike Send +Kris Borchers +Eddie Monge +Israel Tsadok +Carson McDonald +Jason Davies +Garrison Locke +David Murdoch +Benjamin Scott Boyle +Jesse Baird +Jonathan Vingiano +Dylan Just +Hiroshi Tomita +Glenn Goodrich +Tarafder Ashek-E-Elahi +Ryan Neufeld +Marc Neuwirth +Philip Graham +Benjamin Sterling +Wesley Walser +Kouhei Sutou +Karl Kirch +Chris Kelly +Jason Oster +Felix Nagel +Alexander Polomoshnov +David Leal +Igor Milla +Dave Methvin +Florian Gutmann +Marwan Al Jubeh +Milan Broum +Sebastian Sauer +Gaëtan Muller +Michel Weimerskirch +William Griffiths +Stojce Slavkovski +David Soms +David De Sloovere +Michael P. Jung +Shannon Pekary +Dan Wellman +Matthew Edward Hutton +James Khoury +Rob Loach +Alberto Monteiro +Alex Rhea +Krzysztof Rosiński +Ryan Olton +Genie <386@mail.com> +Rick Waldron +Ian Simpson +Lev Kitsis +TJ VanToll +Justin Domnitz +Douglas Cerna +Bert ter Heide +Jasvir Nagra +Yuriy Khabarov <13real008@gmail.com> +Harri Kilpiö +Lado Lomidze +Amir E. Aharoni +Simon Sattes +Jo Liss +Guntupalli Karunakar +Shahyar Ghobadpour +Lukasz Lipinski +Timo Tijhof +Jason Moon +Martin Frost +Eneko Illarramendi +EungJun Yi +Courtland Allen +Viktar Varvanovich +Danny Trunk +Pavel Stetina +Michael Stay +Steven Roussey +Michael Hollis +Lee Rowlands +Timmy Willison +Karl Swedberg +Baoju Yuan +Maciej Mroziński +Luis Dalmolin +Mark Aaron Shirley +Martin Hoch +Jiayi Yang +Philipp Benjamin Köppchen +Sindre Sorhus +Bernhard Sirlinger +Jared A. Scheel +Rafael Xavier de Souza +John Chen +Robert Beuligmann +Dale Kocian +Mike Sherov +Andrew Couch +Marc-Andre Lafortune +Nate Eagle +David Souther +Mathias Stenbom +Sergey Kartashov +Avinash R +Ethan Romba +Cory Gackenheimer +Juan Pablo Kaniefsky +Roman Salnikov +Anika Henke +Samuel Bovée +Fabrício Matté +Viktor Kojouharov +Pawel Maruszczyk (http://hrabstwo.net) +Pavel Selitskas +Bjørn Johansen +Matthieu Penant +Dominic Barnes +David Sullivan +Thomas Jaggi +Vahid Sohrabloo +Travis Carden +Bruno M. Custódio +Nathanael Silverman +Christian Wenz +Steve Urmston +Zaven Muradyan +Woody Gilk +Zbigniew Motyka +Suhail Alkowaileet +Toshi MARUYAMA +David Hansen +Brian Grinstead +Christian Klammer +Steven Luscher +Gan Eng Chin +Gabriel Schulhof +Alexander Schmitz +Vilhjálmur Skúlason +Siebrand Mazeland +Mohsen Ekhtiari +Pere Orga +Jasper de Groot +Stephane Deschamps +Jyoti Deka +Andrei Picus +Ondrej Novy +Jacob McCutcheon +Monika Piotrowicz +Imants Horsts +Eric Dahl +Dave Stein +Dylan Barrell +Daniel DeGroff +Michael Wiencek +Thomas Meyer +Ruslan Yakhyaev +Brian J. Dowling +Ben Higgins +Yermo Lamers +Patrick Stapleton +Trisha Crowley +Usman Akeju +Rodrigo Menezes +Jacques Perrault +Frederik Elvhage +Will Holley +Uri Gilad +Richard Gibson +Simen Bekkhus +Chen Eshchar +Bruno Pérel +Mohammed Alshehri +Lisa Seacat DeLuca +Anne-Gaelle Colom +Adam Foster +Luke Page +Daniel Owens +Michael Orchard +Marcus Warren +Nils Heuermann +Marco Ziech +Patricia Juarez +Ben Mosher +Ablay Keldibek +Thomas Applencourt +Jiabao Wu +Eric Lee Carraway +Victor Homyakov +Myeongjin Lee +Liran Sharir +Weston Ruter +Mani Mishra +Hannah Methvin +Leonardo Balter +Benjamin Albert +Michał Gołębiowski +Alyosha Pushak +Fahad Ahmad +Matt Brundage +Francesc Baeta +Piotr Baran +Mukul Hase +Konstantin Dinev +Rand Scullard +Dan Strohl +Maksim Ryzhikov +Amine HADDAD +Amanpreet Singh +Alexey Balchunas +Peter Kehl +Peter Dave Hello +Johannes Schäfer +Ville Skyttä +Ryan Oriecuia diff --git a/javascript/vendor/jquery-ui-1.12.1.custom/LICENSE.txt b/javascript/vendor/jquery-ui-1.12.1.custom/LICENSE.txt new file mode 100644 index 0000000..4819e54 --- /dev/null +++ b/javascript/vendor/jquery-ui-1.12.1.custom/LICENSE.txt @@ -0,0 +1,43 @@ +Copyright jQuery Foundation and other contributors, https://jquery.org/ + +This software consists of voluntary contributions made by many +individuals. For exact contribution history, see the revision history +available at https://github.com/jquery/jquery-ui + +The following license applies to all parts of this software except as +documented below: + +==== + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +==== + +Copyright and related rights for sample code are waived via CC0. Sample +code is defined as all source code contained within the demos directory. + +CC0: http://creativecommons.org/publicdomain/zero/1.0/ + +==== + +All files located in the node_modules and external directories are +externally maintained libraries used by this software which have their +own licenses; we recommend you read them, as their terms may differ from +the terms above. diff --git a/javascript/vendor/jquery-ui-1.12.1.custom/external/jquery/jquery.js b/javascript/vendor/jquery-ui-1.12.1.custom/external/jquery/jquery.js new file mode 100644 index 0000000..7fc60fc --- /dev/null +++ b/javascript/vendor/jquery-ui-1.12.1.custom/external/jquery/jquery.js @@ -0,0 +1,11008 @@ +/*! + * jQuery JavaScript Library v1.12.4 + * http://jquery.com/ + * + * Includes Sizzle.js + * http://sizzlejs.com/ + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license + * http://jquery.org/license + * + * Date: 2016-05-20T17:17Z + */ + +(function( global, factory ) { + + if ( typeof module === "object" && typeof module.exports === "object" ) { + // For CommonJS and CommonJS-like environments where a proper `window` + // is present, execute the factory and get jQuery. + // For environments that do not have a `window` with a `document` + // (such as Node.js), expose a factory as module.exports. + // This accentuates the need for the creation of a real `window`. + // e.g. var jQuery = require("jquery")(window); + // See ticket #14549 for more info. + module.exports = global.document ? + factory( global, true ) : + function( w ) { + if ( !w.document ) { + throw new Error( "jQuery requires a window with a document" ); + } + return factory( w ); + }; + } else { + factory( global ); + } + +// Pass this if window is not defined yet +}(typeof window !== "undefined" ? window : this, function( window, noGlobal ) { + +// Support: Firefox 18+ +// Can't be in strict mode, several libs including ASP.NET trace +// the stack via arguments.caller.callee and Firefox dies if +// you try to trace through "use strict" call chains. (#13335) +//"use strict"; +var deletedIds = []; + +var document = window.document; + +var slice = deletedIds.slice; + +var concat = deletedIds.concat; + +var push = deletedIds.push; + +var indexOf = deletedIds.indexOf; + +var class2type = {}; + +var toString = class2type.toString; + +var hasOwn = class2type.hasOwnProperty; + +var support = {}; + + + +var + version = "1.12.4", + + // Define a local copy of jQuery + jQuery = function( selector, context ) { + + // The jQuery object is actually just the init constructor 'enhanced' + // Need init if jQuery is called (just allow error to be thrown if not included) + return new jQuery.fn.init( selector, context ); + }, + + // Support: Android<4.1, IE<9 + // Make sure we trim BOM and NBSP + rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, + + // Matches dashed string for camelizing + rmsPrefix = /^-ms-/, + rdashAlpha = /-([\da-z])/gi, + + // Used by jQuery.camelCase as callback to replace() + fcamelCase = function( all, letter ) { + return letter.toUpperCase(); + }; + +jQuery.fn = jQuery.prototype = { + + // The current version of jQuery being used + jquery: version, + + constructor: jQuery, + + // Start with an empty selector + selector: "", + + // The default length of a jQuery object is 0 + length: 0, + + toArray: function() { + return slice.call( this ); + }, + + // Get the Nth element in the matched element set OR + // Get the whole matched element set as a clean array + get: function( num ) { + return num != null ? + + // Return just the one element from the set + ( num < 0 ? this[ num + this.length ] : this[ num ] ) : + + // Return all the elements in a clean array + slice.call( this ); + }, + + // Take an array of elements and push it onto the stack + // (returning the new matched element set) + pushStack: function( elems ) { + + // Build a new jQuery matched element set + var ret = jQuery.merge( this.constructor(), elems ); + + // Add the old object onto the stack (as a reference) + ret.prevObject = this; + ret.context = this.context; + + // Return the newly-formed element set + return ret; + }, + + // Execute a callback for every element in the matched set. + each: function( callback ) { + return jQuery.each( this, callback ); + }, + + map: function( callback ) { + return this.pushStack( jQuery.map( this, function( elem, i ) { + return callback.call( elem, i, elem ); + } ) ); + }, + + slice: function() { + return this.pushStack( slice.apply( this, arguments ) ); + }, + + first: function() { + return this.eq( 0 ); + }, + + last: function() { + return this.eq( -1 ); + }, + + eq: function( i ) { + var len = this.length, + j = +i + ( i < 0 ? len : 0 ); + return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] ); + }, + + end: function() { + return this.prevObject || this.constructor(); + }, + + // For internal use only. + // Behaves like an Array's method, not like a jQuery method. + push: push, + sort: deletedIds.sort, + splice: deletedIds.splice +}; + +jQuery.extend = jQuery.fn.extend = function() { + var src, copyIsArray, copy, name, options, clone, + target = arguments[ 0 ] || {}, + i = 1, + length = arguments.length, + deep = false; + + // Handle a deep copy situation + if ( typeof target === "boolean" ) { + deep = target; + + // skip the boolean and the target + target = arguments[ i ] || {}; + i++; + } + + // Handle case when target is a string or something (possible in deep copy) + if ( typeof target !== "object" && !jQuery.isFunction( target ) ) { + target = {}; + } + + // extend jQuery itself if only one argument is passed + if ( i === length ) { + target = this; + i--; + } + + for ( ; i < length; i++ ) { + + // Only deal with non-null/undefined values + if ( ( options = arguments[ i ] ) != null ) { + + // Extend the base object + for ( name in options ) { + src = target[ name ]; + copy = options[ name ]; + + // Prevent never-ending loop + if ( target === copy ) { + continue; + } + + // Recurse if we're merging plain objects or arrays + if ( deep && copy && ( jQuery.isPlainObject( copy ) || + ( copyIsArray = jQuery.isArray( copy ) ) ) ) { + + if ( copyIsArray ) { + copyIsArray = false; + clone = src && jQuery.isArray( src ) ? src : []; + + } else { + clone = src && jQuery.isPlainObject( src ) ? src : {}; + } + + // Never move original objects, clone them + target[ name ] = jQuery.extend( deep, clone, copy ); + + // Don't bring in undefined values + } else if ( copy !== undefined ) { + target[ name ] = copy; + } + } + } + } + + // Return the modified object + return target; +}; + +jQuery.extend( { + + // Unique for each copy of jQuery on the page + expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ), + + // Assume jQuery is ready without the ready module + isReady: true, + + error: function( msg ) { + throw new Error( msg ); + }, + + noop: function() {}, + + // See test/unit/core.js for details concerning isFunction. + // Since version 1.3, DOM methods and functions like alert + // aren't supported. They return false on IE (#2968). + isFunction: function( obj ) { + return jQuery.type( obj ) === "function"; + }, + + isArray: Array.isArray || function( obj ) { + return jQuery.type( obj ) === "array"; + }, + + isWindow: function( obj ) { + /* jshint eqeqeq: false */ + return obj != null && obj == obj.window; + }, + + isNumeric: function( obj ) { + + // parseFloat NaNs numeric-cast false positives (null|true|false|"") + // ...but misinterprets leading-number strings, particularly hex literals ("0x...") + // subtraction forces infinities to NaN + // adding 1 corrects loss of precision from parseFloat (#15100) + var realStringObj = obj && obj.toString(); + return !jQuery.isArray( obj ) && ( realStringObj - parseFloat( realStringObj ) + 1 ) >= 0; + }, + + isEmptyObject: function( obj ) { + var name; + for ( name in obj ) { + return false; + } + return true; + }, + + isPlainObject: function( obj ) { + var key; + + // Must be an Object. + // Because of IE, we also have to check the presence of the constructor property. + // Make sure that DOM nodes and window objects don't pass through, as well + if ( !obj || jQuery.type( obj ) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { + return false; + } + + try { + + // Not own constructor property must be Object + if ( obj.constructor && + !hasOwn.call( obj, "constructor" ) && + !hasOwn.call( obj.constructor.prototype, "isPrototypeOf" ) ) { + return false; + } + } catch ( e ) { + + // IE8,9 Will throw exceptions on certain host objects #9897 + return false; + } + + // Support: IE<9 + // Handle iteration over inherited properties before own properties. + if ( !support.ownFirst ) { + for ( key in obj ) { + return hasOwn.call( obj, key ); + } + } + + // Own properties are enumerated firstly, so to speed up, + // if last one is own, then all properties are own. + for ( key in obj ) {} + + return key === undefined || hasOwn.call( obj, key ); + }, + + type: function( obj ) { + if ( obj == null ) { + return obj + ""; + } + return typeof obj === "object" || typeof obj === "function" ? + class2type[ toString.call( obj ) ] || "object" : + typeof obj; + }, + + // Workarounds based on findings by Jim Driscoll + // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context + globalEval: function( data ) { + if ( data && jQuery.trim( data ) ) { + + // We use execScript on Internet Explorer + // We use an anonymous function so that context is window + // rather than jQuery in Firefox + ( window.execScript || function( data ) { + window[ "eval" ].call( window, data ); // jscs:ignore requireDotNotation + } )( data ); + } + }, + + // Convert dashed to camelCase; used by the css and data modules + // Microsoft forgot to hump their vendor prefix (#9572) + camelCase: function( string ) { + return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); + }, + + nodeName: function( elem, name ) { + return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); + }, + + each: function( obj, callback ) { + var length, i = 0; + + if ( isArrayLike( obj ) ) { + length = obj.length; + for ( ; i < length; i++ ) { + if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { + break; + } + } + } else { + for ( i in obj ) { + if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { + break; + } + } + } + + return obj; + }, + + // Support: Android<4.1, IE<9 + trim: function( text ) { + return text == null ? + "" : + ( text + "" ).replace( rtrim, "" ); + }, + + // results is for internal usage only + makeArray: function( arr, results ) { + var ret = results || []; + + if ( arr != null ) { + if ( isArrayLike( Object( arr ) ) ) { + jQuery.merge( ret, + typeof arr === "string" ? + [ arr ] : arr + ); + } else { + push.call( ret, arr ); + } + } + + return ret; + }, + + inArray: function( elem, arr, i ) { + var len; + + if ( arr ) { + if ( indexOf ) { + return indexOf.call( arr, elem, i ); + } + + len = arr.length; + i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0; + + for ( ; i < len; i++ ) { + + // Skip accessing in sparse arrays + if ( i in arr && arr[ i ] === elem ) { + return i; + } + } + } + + return -1; + }, + + merge: function( first, second ) { + var len = +second.length, + j = 0, + i = first.length; + + while ( j < len ) { + first[ i++ ] = second[ j++ ]; + } + + // Support: IE<9 + // Workaround casting of .length to NaN on otherwise arraylike objects (e.g., NodeLists) + if ( len !== len ) { + while ( second[ j ] !== undefined ) { + first[ i++ ] = second[ j++ ]; + } + } + + first.length = i; + + return first; + }, + + grep: function( elems, callback, invert ) { + var callbackInverse, + matches = [], + i = 0, + length = elems.length, + callbackExpect = !invert; + + // Go through the array, only saving the items + // that pass the validator function + for ( ; i < length; i++ ) { + callbackInverse = !callback( elems[ i ], i ); + if ( callbackInverse !== callbackExpect ) { + matches.push( elems[ i ] ); + } + } + + return matches; + }, + + // arg is for internal usage only + map: function( elems, callback, arg ) { + var length, value, + i = 0, + ret = []; + + // Go through the array, translating each of the items to their new values + if ( isArrayLike( elems ) ) { + length = elems.length; + for ( ; i < length; i++ ) { + value = callback( elems[ i ], i, arg ); + + if ( value != null ) { + ret.push( value ); + } + } + + // Go through every key on the object, + } else { + for ( i in elems ) { + value = callback( elems[ i ], i, arg ); + + if ( value != null ) { + ret.push( value ); + } + } + } + + // Flatten any nested arrays + return concat.apply( [], ret ); + }, + + // A global GUID counter for objects + guid: 1, + + // Bind a function to a context, optionally partially applying any + // arguments. + proxy: function( fn, context ) { + var args, proxy, tmp; + + if ( typeof context === "string" ) { + tmp = fn[ context ]; + context = fn; + fn = tmp; + } + + // Quick check to determine if target is callable, in the spec + // this throws a TypeError, but we will just return undefined. + if ( !jQuery.isFunction( fn ) ) { + return undefined; + } + + // Simulated bind + args = slice.call( arguments, 2 ); + proxy = function() { + return fn.apply( context || this, args.concat( slice.call( arguments ) ) ); + }; + + // Set the guid of unique handler to the same of original handler, so it can be removed + proxy.guid = fn.guid = fn.guid || jQuery.guid++; + + return proxy; + }, + + now: function() { + return +( new Date() ); + }, + + // jQuery.support is not used in Core but other projects attach their + // properties to it so it needs to exist. + support: support +} ); + +// JSHint would error on this code due to the Symbol not being defined in ES5. +// Defining this global in .jshintrc would create a danger of using the global +// unguarded in another place, it seems safer to just disable JSHint for these +// three lines. +/* jshint ignore: start */ +if ( typeof Symbol === "function" ) { + jQuery.fn[ Symbol.iterator ] = deletedIds[ Symbol.iterator ]; +} +/* jshint ignore: end */ + +// Populate the class2type map +jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ), +function( i, name ) { + class2type[ "[object " + name + "]" ] = name.toLowerCase(); +} ); + +function isArrayLike( obj ) { + + // Support: iOS 8.2 (not reproducible in simulator) + // `in` check used to prevent JIT error (gh-2145) + // hasOwn isn't used here due to false negatives + // regarding Nodelist length in IE + var length = !!obj && "length" in obj && obj.length, + type = jQuery.type( obj ); + + if ( type === "function" || jQuery.isWindow( obj ) ) { + return false; + } + + return type === "array" || length === 0 || + typeof length === "number" && length > 0 && ( length - 1 ) in obj; +} +var Sizzle = +/*! + * Sizzle CSS Selector Engine v2.2.1 + * http://sizzlejs.com/ + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license + * http://jquery.org/license + * + * Date: 2015-10-17 + */ +(function( window ) { + +var i, + support, + Expr, + getText, + isXML, + tokenize, + compile, + select, + outermostContext, + sortInput, + hasDuplicate, + + // Local document vars + setDocument, + document, + docElem, + documentIsHTML, + rbuggyQSA, + rbuggyMatches, + matches, + contains, + + // Instance-specific data + expando = "sizzle" + 1 * new Date(), + preferredDoc = window.document, + dirruns = 0, + done = 0, + classCache = createCache(), + tokenCache = createCache(), + compilerCache = createCache(), + sortOrder = function( a, b ) { + if ( a === b ) { + hasDuplicate = true; + } + return 0; + }, + + // General-purpose constants + MAX_NEGATIVE = 1 << 31, + + // Instance methods + hasOwn = ({}).hasOwnProperty, + arr = [], + pop = arr.pop, + push_native = arr.push, + push = arr.push, + slice = arr.slice, + // Use a stripped-down indexOf as it's faster than native + // http://jsperf.com/thor-indexof-vs-for/5 + indexOf = function( list, elem ) { + var i = 0, + len = list.length; + for ( ; i < len; i++ ) { + if ( list[i] === elem ) { + return i; + } + } + return -1; + }, + + booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", + + // Regular expressions + + // http://www.w3.org/TR/css3-selectors/#whitespace + whitespace = "[\\x20\\t\\r\\n\\f]", + + // http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier + identifier = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", + + // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors + attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace + + // Operator (capture 2) + "*([*^$|!~]?=)" + whitespace + + // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]" + "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace + + "*\\]", + + pseudos = ":(" + identifier + ")(?:\\((" + + // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments: + // 1. quoted (capture 3; capture 4 or capture 5) + "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" + + // 2. simple (capture 6) + "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" + + // 3. anything else (capture 2) + ".*" + + ")\\)|)", + + // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter + rwhitespace = new RegExp( whitespace + "+", "g" ), + rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ), + + rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), + rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ), + + rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ), + + rpseudo = new RegExp( pseudos ), + ridentifier = new RegExp( "^" + identifier + "$" ), + + matchExpr = { + "ID": new RegExp( "^#(" + identifier + ")" ), + "CLASS": new RegExp( "^\\.(" + identifier + ")" ), + "TAG": new RegExp( "^(" + identifier + "|[*])" ), + "ATTR": new RegExp( "^" + attributes ), + "PSEUDO": new RegExp( "^" + pseudos ), + "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), + "bool": new RegExp( "^(?:" + booleans + ")$", "i" ), + // For use in libraries implementing .is() + // We use this for POS matching in `select` + "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + + whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) + }, + + rinputs = /^(?:input|select|textarea|button)$/i, + rheader = /^h\d$/i, + + rnative = /^[^{]+\{\s*\[native \w/, + + // Easily-parseable/retrievable ID or TAG or CLASS selectors + rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, + + rsibling = /[+~]/, + rescape = /'|\\/g, + + // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters + runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ), + funescape = function( _, escaped, escapedWhitespace ) { + var high = "0x" + escaped - 0x10000; + // NaN means non-codepoint + // Support: Firefox<24 + // Workaround erroneous numeric interpretation of +"0x" + return high !== high || escapedWhitespace ? + escaped : + high < 0 ? + // BMP codepoint + String.fromCharCode( high + 0x10000 ) : + // Supplemental Plane codepoint (surrogate pair) + String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); + }, + + // Used for iframes + // See setDocument() + // Removing the function wrapper causes a "Permission Denied" + // error in IE + unloadHandler = function() { + setDocument(); + }; + +// Optimize for push.apply( _, NodeList ) +try { + push.apply( + (arr = slice.call( preferredDoc.childNodes )), + preferredDoc.childNodes + ); + // Support: Android<4.0 + // Detect silently failing push.apply + arr[ preferredDoc.childNodes.length ].nodeType; +} catch ( e ) { + push = { apply: arr.length ? + + // Leverage slice if possible + function( target, els ) { + push_native.apply( target, slice.call(els) ); + } : + + // Support: IE<9 + // Otherwise append directly + function( target, els ) { + var j = target.length, + i = 0; + // Can't trust NodeList.length + while ( (target[j++] = els[i++]) ) {} + target.length = j - 1; + } + }; +} + +function Sizzle( selector, context, results, seed ) { + var m, i, elem, nid, nidselect, match, groups, newSelector, + newContext = context && context.ownerDocument, + + // nodeType defaults to 9, since context defaults to document + nodeType = context ? context.nodeType : 9; + + results = results || []; + + // Return early from calls with invalid selector or context + if ( typeof selector !== "string" || !selector || + nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) { + + return results; + } + + // Try to shortcut find operations (as opposed to filters) in HTML documents + if ( !seed ) { + + if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) { + setDocument( context ); + } + context = context || document; + + if ( documentIsHTML ) { + + // If the selector is sufficiently simple, try using a "get*By*" DOM method + // (excepting DocumentFragment context, where the methods don't exist) + if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) { + + // ID selector + if ( (m = match[1]) ) { + + // Document context + if ( nodeType === 9 ) { + if ( (elem = context.getElementById( m )) ) { + + // Support: IE, Opera, Webkit + // TODO: identify versions + // getElementById can match elements by name instead of ID + if ( elem.id === m ) { + results.push( elem ); + return results; + } + } else { + return results; + } + + // Element context + } else { + + // Support: IE, Opera, Webkit + // TODO: identify versions + // getElementById can match elements by name instead of ID + if ( newContext && (elem = newContext.getElementById( m )) && + contains( context, elem ) && + elem.id === m ) { + + results.push( elem ); + return results; + } + } + + // Type selector + } else if ( match[2] ) { + push.apply( results, context.getElementsByTagName( selector ) ); + return results; + + // Class selector + } else if ( (m = match[3]) && support.getElementsByClassName && + context.getElementsByClassName ) { + + push.apply( results, context.getElementsByClassName( m ) ); + return results; + } + } + + // Take advantage of querySelectorAll + if ( support.qsa && + !compilerCache[ selector + " " ] && + (!rbuggyQSA || !rbuggyQSA.test( selector )) ) { + + if ( nodeType !== 1 ) { + newContext = context; + newSelector = selector; + + // qSA looks outside Element context, which is not what we want + // Thanks to Andrew Dupont for this workaround technique + // Support: IE <=8 + // Exclude object elements + } else if ( context.nodeName.toLowerCase() !== "object" ) { + + // Capture the context ID, setting it first if necessary + if ( (nid = context.getAttribute( "id" )) ) { + nid = nid.replace( rescape, "\\$&" ); + } else { + context.setAttribute( "id", (nid = expando) ); + } + + // Prefix every selector in the list + groups = tokenize( selector ); + i = groups.length; + nidselect = ridentifier.test( nid ) ? "#" + nid : "[id='" + nid + "']"; + while ( i-- ) { + groups[i] = nidselect + " " + toSelector( groups[i] ); + } + newSelector = groups.join( "," ); + + // Expand context for sibling selectors + newContext = rsibling.test( selector ) && testContext( context.parentNode ) || + context; + } + + if ( newSelector ) { + try { + push.apply( results, + newContext.querySelectorAll( newSelector ) + ); + return results; + } catch ( qsaError ) { + } finally { + if ( nid === expando ) { + context.removeAttribute( "id" ); + } + } + } + } + } + } + + // All others + return select( selector.replace( rtrim, "$1" ), context, results, seed ); +} + +/** + * Create key-value caches of limited size + * @returns {function(string, object)} Returns the Object data after storing it on itself with + * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) + * deleting the oldest entry + */ +function createCache() { + var keys = []; + + function cache( key, value ) { + // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) + if ( keys.push( key + " " ) > Expr.cacheLength ) { + // Only keep the most recent entries + delete cache[ keys.shift() ]; + } + return (cache[ key + " " ] = value); + } + return cache; +} + +/** + * Mark a function for special use by Sizzle + * @param {Function} fn The function to mark + */ +function markFunction( fn ) { + fn[ expando ] = true; + return fn; +} + +/** + * Support testing using an element + * @param {Function} fn Passed the created div and expects a boolean result + */ +function assert( fn ) { + var div = document.createElement("div"); + + try { + return !!fn( div ); + } catch (e) { + return false; + } finally { + // Remove from its parent by default + if ( div.parentNode ) { + div.parentNode.removeChild( div ); + } + // release memory in IE + div = null; + } +} + +/** + * Adds the same handler for all of the specified attrs + * @param {String} attrs Pipe-separated list of attributes + * @param {Function} handler The method that will be applied + */ +function addHandle( attrs, handler ) { + var arr = attrs.split("|"), + i = arr.length; + + while ( i-- ) { + Expr.attrHandle[ arr[i] ] = handler; + } +} + +/** + * Checks document order of two siblings + * @param {Element} a + * @param {Element} b + * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b + */ +function siblingCheck( a, b ) { + var cur = b && a, + diff = cur && a.nodeType === 1 && b.nodeType === 1 && + ( ~b.sourceIndex || MAX_NEGATIVE ) - + ( ~a.sourceIndex || MAX_NEGATIVE ); + + // Use IE sourceIndex if available on both nodes + if ( diff ) { + return diff; + } + + // Check if b follows a + if ( cur ) { + while ( (cur = cur.nextSibling) ) { + if ( cur === b ) { + return -1; + } + } + } + + return a ? 1 : -1; +} + +/** + * Returns a function to use in pseudos for input types + * @param {String} type + */ +function createInputPseudo( type ) { + return function( elem ) { + var name = elem.nodeName.toLowerCase(); + return name === "input" && elem.type === type; + }; +} + +/** + * Returns a function to use in pseudos for buttons + * @param {String} type + */ +function createButtonPseudo( type ) { + return function( elem ) { + var name = elem.nodeName.toLowerCase(); + return (name === "input" || name === "button") && elem.type === type; + }; +} + +/** + * Returns a function to use in pseudos for positionals + * @param {Function} fn + */ +function createPositionalPseudo( fn ) { + return markFunction(function( argument ) { + argument = +argument; + return markFunction(function( seed, matches ) { + var j, + matchIndexes = fn( [], seed.length, argument ), + i = matchIndexes.length; + + // Match elements found at the specified indexes + while ( i-- ) { + if ( seed[ (j = matchIndexes[i]) ] ) { + seed[j] = !(matches[j] = seed[j]); + } + } + }); + }); +} + +/** + * Checks a node for validity as a Sizzle context + * @param {Element|Object=} context + * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value + */ +function testContext( context ) { + return context && typeof context.getElementsByTagName !== "undefined" && context; +} + +// Expose support vars for convenience +support = Sizzle.support = {}; + +/** + * Detects XML nodes + * @param {Element|Object} elem An element or a document + * @returns {Boolean} True iff elem is a non-HTML XML node + */ +isXML = Sizzle.isXML = function( elem ) { + // documentElement is verified for cases where it doesn't yet exist + // (such as loading iframes in IE - #4833) + var documentElement = elem && (elem.ownerDocument || elem).documentElement; + return documentElement ? documentElement.nodeName !== "HTML" : false; +}; + +/** + * Sets document-related variables once based on the current document + * @param {Element|Object} [doc] An element or document object to use to set the document + * @returns {Object} Returns the current document + */ +setDocument = Sizzle.setDocument = function( node ) { + var hasCompare, parent, + doc = node ? node.ownerDocument || node : preferredDoc; + + // Return early if doc is invalid or already selected + if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) { + return document; + } + + // Update global variables + document = doc; + docElem = document.documentElement; + documentIsHTML = !isXML( document ); + + // Support: IE 9-11, Edge + // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936) + if ( (parent = document.defaultView) && parent.top !== parent ) { + // Support: IE 11 + if ( parent.addEventListener ) { + parent.addEventListener( "unload", unloadHandler, false ); + + // Support: IE 9 - 10 only + } else if ( parent.attachEvent ) { + parent.attachEvent( "onunload", unloadHandler ); + } + } + + /* Attributes + ---------------------------------------------------------------------- */ + + // Support: IE<8 + // Verify that getAttribute really returns attributes and not properties + // (excepting IE8 booleans) + support.attributes = assert(function( div ) { + div.className = "i"; + return !div.getAttribute("className"); + }); + + /* getElement(s)By* + ---------------------------------------------------------------------- */ + + // Check if getElementsByTagName("*") returns only elements + support.getElementsByTagName = assert(function( div ) { + div.appendChild( document.createComment("") ); + return !div.getElementsByTagName("*").length; + }); + + // Support: IE<9 + support.getElementsByClassName = rnative.test( document.getElementsByClassName ); + + // Support: IE<10 + // Check if getElementById returns elements by name + // The broken getElementById methods don't pick up programatically-set names, + // so use a roundabout getElementsByName test + support.getById = assert(function( div ) { + docElem.appendChild( div ).id = expando; + return !document.getElementsByName || !document.getElementsByName( expando ).length; + }); + + // ID find and filter + if ( support.getById ) { + Expr.find["ID"] = function( id, context ) { + if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { + var m = context.getElementById( id ); + return m ? [ m ] : []; + } + }; + Expr.filter["ID"] = function( id ) { + var attrId = id.replace( runescape, funescape ); + return function( elem ) { + return elem.getAttribute("id") === attrId; + }; + }; + } else { + // Support: IE6/7 + // getElementById is not reliable as a find shortcut + delete Expr.find["ID"]; + + Expr.filter["ID"] = function( id ) { + var attrId = id.replace( runescape, funescape ); + return function( elem ) { + var node = typeof elem.getAttributeNode !== "undefined" && + elem.getAttributeNode("id"); + return node && node.value === attrId; + }; + }; + } + + // Tag + Expr.find["TAG"] = support.getElementsByTagName ? + function( tag, context ) { + if ( typeof context.getElementsByTagName !== "undefined" ) { + return context.getElementsByTagName( tag ); + + // DocumentFragment nodes don't have gEBTN + } else if ( support.qsa ) { + return context.querySelectorAll( tag ); + } + } : + + function( tag, context ) { + var elem, + tmp = [], + i = 0, + // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too + results = context.getElementsByTagName( tag ); + + // Filter out possible comments + if ( tag === "*" ) { + while ( (elem = results[i++]) ) { + if ( elem.nodeType === 1 ) { + tmp.push( elem ); + } + } + + return tmp; + } + return results; + }; + + // Class + Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) { + if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) { + return context.getElementsByClassName( className ); + } + }; + + /* QSA/matchesSelector + ---------------------------------------------------------------------- */ + + // QSA and matchesSelector support + + // matchesSelector(:active) reports false when true (IE9/Opera 11.5) + rbuggyMatches = []; + + // qSa(:focus) reports false when true (Chrome 21) + // We allow this because of a bug in IE8/9 that throws an error + // whenever `document.activeElement` is accessed on an iframe + // So, we allow :focus to pass through QSA all the time to avoid the IE error + // See http://bugs.jquery.com/ticket/13378 + rbuggyQSA = []; + + if ( (support.qsa = rnative.test( document.querySelectorAll )) ) { + // Build QSA regex + // Regex strategy adopted from Diego Perini + assert(function( div ) { + // Select is set to empty string on purpose + // This is to test IE's treatment of not explicitly + // setting a boolean content attribute, + // since its presence should be enough + // http://bugs.jquery.com/ticket/12359 + docElem.appendChild( div ).innerHTML = "" + + ""; + + // Support: IE8, Opera 11-12.16 + // Nothing should be selected when empty strings follow ^= or $= or *= + // The test attribute must be unknown in Opera but "safe" for WinRT + // http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section + if ( div.querySelectorAll("[msallowcapture^='']").length ) { + rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); + } + + // Support: IE8 + // Boolean attributes and "value" are not treated correctly + if ( !div.querySelectorAll("[selected]").length ) { + rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); + } + + // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+ + if ( !div.querySelectorAll( "[id~=" + expando + "-]" ).length ) { + rbuggyQSA.push("~="); + } + + // Webkit/Opera - :checked should return selected option elements + // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked + // IE8 throws error here and will not see later tests + if ( !div.querySelectorAll(":checked").length ) { + rbuggyQSA.push(":checked"); + } + + // Support: Safari 8+, iOS 8+ + // https://bugs.webkit.org/show_bug.cgi?id=136851 + // In-page `selector#id sibing-combinator selector` fails + if ( !div.querySelectorAll( "a#" + expando + "+*" ).length ) { + rbuggyQSA.push(".#.+[+~]"); + } + }); + + assert(function( div ) { + // Support: Windows 8 Native Apps + // The type and name attributes are restricted during .innerHTML assignment + var input = document.createElement("input"); + input.setAttribute( "type", "hidden" ); + div.appendChild( input ).setAttribute( "name", "D" ); + + // Support: IE8 + // Enforce case-sensitivity of name attribute + if ( div.querySelectorAll("[name=d]").length ) { + rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" ); + } + + // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) + // IE8 throws error here and will not see later tests + if ( !div.querySelectorAll(":enabled").length ) { + rbuggyQSA.push( ":enabled", ":disabled" ); + } + + // Opera 10-11 does not throw on post-comma invalid pseudos + div.querySelectorAll("*,:x"); + rbuggyQSA.push(",.*:"); + }); + } + + if ( (support.matchesSelector = rnative.test( (matches = docElem.matches || + docElem.webkitMatchesSelector || + docElem.mozMatchesSelector || + docElem.oMatchesSelector || + docElem.msMatchesSelector) )) ) { + + assert(function( div ) { + // Check to see if it's possible to do matchesSelector + // on a disconnected node (IE 9) + support.disconnectedMatch = matches.call( div, "div" ); + + // This should fail with an exception + // Gecko does not error, returns false instead + matches.call( div, "[s!='']:x" ); + rbuggyMatches.push( "!=", pseudos ); + }); + } + + rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") ); + rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") ); + + /* Contains + ---------------------------------------------------------------------- */ + hasCompare = rnative.test( docElem.compareDocumentPosition ); + + // Element contains another + // Purposefully self-exclusive + // As in, an element does not contain itself + contains = hasCompare || rnative.test( docElem.contains ) ? + function( a, b ) { + var adown = a.nodeType === 9 ? a.documentElement : a, + bup = b && b.parentNode; + return a === bup || !!( bup && bup.nodeType === 1 && ( + adown.contains ? + adown.contains( bup ) : + a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 + )); + } : + function( a, b ) { + if ( b ) { + while ( (b = b.parentNode) ) { + if ( b === a ) { + return true; + } + } + } + return false; + }; + + /* Sorting + ---------------------------------------------------------------------- */ + + // Document order sorting + sortOrder = hasCompare ? + function( a, b ) { + + // Flag for duplicate removal + if ( a === b ) { + hasDuplicate = true; + return 0; + } + + // Sort on method existence if only one input has compareDocumentPosition + var compare = !a.compareDocumentPosition - !b.compareDocumentPosition; + if ( compare ) { + return compare; + } + + // Calculate position if both inputs belong to the same document + compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ? + a.compareDocumentPosition( b ) : + + // Otherwise we know they are disconnected + 1; + + // Disconnected nodes + if ( compare & 1 || + (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) { + + // Choose the first element that is related to our preferred document + if ( a === document || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) { + return -1; + } + if ( b === document || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) { + return 1; + } + + // Maintain original order + return sortInput ? + ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : + 0; + } + + return compare & 4 ? -1 : 1; + } : + function( a, b ) { + // Exit early if the nodes are identical + if ( a === b ) { + hasDuplicate = true; + return 0; + } + + var cur, + i = 0, + aup = a.parentNode, + bup = b.parentNode, + ap = [ a ], + bp = [ b ]; + + // Parentless nodes are either documents or disconnected + if ( !aup || !bup ) { + return a === document ? -1 : + b === document ? 1 : + aup ? -1 : + bup ? 1 : + sortInput ? + ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : + 0; + + // If the nodes are siblings, we can do a quick check + } else if ( aup === bup ) { + return siblingCheck( a, b ); + } + + // Otherwise we need full lists of their ancestors for comparison + cur = a; + while ( (cur = cur.parentNode) ) { + ap.unshift( cur ); + } + cur = b; + while ( (cur = cur.parentNode) ) { + bp.unshift( cur ); + } + + // Walk down the tree looking for a discrepancy + while ( ap[i] === bp[i] ) { + i++; + } + + return i ? + // Do a sibling check if the nodes have a common ancestor + siblingCheck( ap[i], bp[i] ) : + + // Otherwise nodes in our document sort first + ap[i] === preferredDoc ? -1 : + bp[i] === preferredDoc ? 1 : + 0; + }; + + return document; +}; + +Sizzle.matches = function( expr, elements ) { + return Sizzle( expr, null, null, elements ); +}; + +Sizzle.matchesSelector = function( elem, expr ) { + // Set document vars if needed + if ( ( elem.ownerDocument || elem ) !== document ) { + setDocument( elem ); + } + + // Make sure that attribute selectors are quoted + expr = expr.replace( rattributeQuotes, "='$1']" ); + + if ( support.matchesSelector && documentIsHTML && + !compilerCache[ expr + " " ] && + ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) && + ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { + + try { + var ret = matches.call( elem, expr ); + + // IE 9's matchesSelector returns false on disconnected nodes + if ( ret || support.disconnectedMatch || + // As well, disconnected nodes are said to be in a document + // fragment in IE 9 + elem.document && elem.document.nodeType !== 11 ) { + return ret; + } + } catch (e) {} + } + + return Sizzle( expr, document, null, [ elem ] ).length > 0; +}; + +Sizzle.contains = function( context, elem ) { + // Set document vars if needed + if ( ( context.ownerDocument || context ) !== document ) { + setDocument( context ); + } + return contains( context, elem ); +}; + +Sizzle.attr = function( elem, name ) { + // Set document vars if needed + if ( ( elem.ownerDocument || elem ) !== document ) { + setDocument( elem ); + } + + var fn = Expr.attrHandle[ name.toLowerCase() ], + // Don't get fooled by Object.prototype properties (jQuery #13807) + val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? + fn( elem, name, !documentIsHTML ) : + undefined; + + return val !== undefined ? + val : + support.attributes || !documentIsHTML ? + elem.getAttribute( name ) : + (val = elem.getAttributeNode(name)) && val.specified ? + val.value : + null; +}; + +Sizzle.error = function( msg ) { + throw new Error( "Syntax error, unrecognized expression: " + msg ); +}; + +/** + * Document sorting and removing duplicates + * @param {ArrayLike} results + */ +Sizzle.uniqueSort = function( results ) { + var elem, + duplicates = [], + j = 0, + i = 0; + + // Unless we *know* we can detect duplicates, assume their presence + hasDuplicate = !support.detectDuplicates; + sortInput = !support.sortStable && results.slice( 0 ); + results.sort( sortOrder ); + + if ( hasDuplicate ) { + while ( (elem = results[i++]) ) { + if ( elem === results[ i ] ) { + j = duplicates.push( i ); + } + } + while ( j-- ) { + results.splice( duplicates[ j ], 1 ); + } + } + + // Clear input after sorting to release objects + // See https://github.com/jquery/sizzle/pull/225 + sortInput = null; + + return results; +}; + +/** + * Utility function for retrieving the text value of an array of DOM nodes + * @param {Array|Element} elem + */ +getText = Sizzle.getText = function( elem ) { + var node, + ret = "", + i = 0, + nodeType = elem.nodeType; + + if ( !nodeType ) { + // If no nodeType, this is expected to be an array + while ( (node = elem[i++]) ) { + // Do not traverse comment nodes + ret += getText( node ); + } + } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { + // Use textContent for elements + // innerText usage removed for consistency of new lines (jQuery #11153) + if ( typeof elem.textContent === "string" ) { + return elem.textContent; + } else { + // Traverse its children + for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { + ret += getText( elem ); + } + } + } else if ( nodeType === 3 || nodeType === 4 ) { + return elem.nodeValue; + } + // Do not include comment or processing instruction nodes + + return ret; +}; + +Expr = Sizzle.selectors = { + + // Can be adjusted by the user + cacheLength: 50, + + createPseudo: markFunction, + + match: matchExpr, + + attrHandle: {}, + + find: {}, + + relative: { + ">": { dir: "parentNode", first: true }, + " ": { dir: "parentNode" }, + "+": { dir: "previousSibling", first: true }, + "~": { dir: "previousSibling" } + }, + + preFilter: { + "ATTR": function( match ) { + match[1] = match[1].replace( runescape, funescape ); + + // Move the given value to match[3] whether quoted or unquoted + match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape ); + + if ( match[2] === "~=" ) { + match[3] = " " + match[3] + " "; + } + + return match.slice( 0, 4 ); + }, + + "CHILD": function( match ) { + /* matches from matchExpr["CHILD"] + 1 type (only|nth|...) + 2 what (child|of-type) + 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) + 4 xn-component of xn+y argument ([+-]?\d*n|) + 5 sign of xn-component + 6 x of xn-component + 7 sign of y-component + 8 y of y-component + */ + match[1] = match[1].toLowerCase(); + + if ( match[1].slice( 0, 3 ) === "nth" ) { + // nth-* requires argument + if ( !match[3] ) { + Sizzle.error( match[0] ); + } + + // numeric x and y parameters for Expr.filter.CHILD + // remember that false/true cast respectively to 0/1 + match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) ); + match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" ); + + // other types prohibit arguments + } else if ( match[3] ) { + Sizzle.error( match[0] ); + } + + return match; + }, + + "PSEUDO": function( match ) { + var excess, + unquoted = !match[6] && match[2]; + + if ( matchExpr["CHILD"].test( match[0] ) ) { + return null; + } + + // Accept quoted arguments as-is + if ( match[3] ) { + match[2] = match[4] || match[5] || ""; + + // Strip excess characters from unquoted arguments + } else if ( unquoted && rpseudo.test( unquoted ) && + // Get excess from tokenize (recursively) + (excess = tokenize( unquoted, true )) && + // advance to the next closing parenthesis + (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) { + + // excess is a negative index + match[0] = match[0].slice( 0, excess ); + match[2] = unquoted.slice( 0, excess ); + } + + // Return only captures needed by the pseudo filter method (type and argument) + return match.slice( 0, 3 ); + } + }, + + filter: { + + "TAG": function( nodeNameSelector ) { + var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); + return nodeNameSelector === "*" ? + function() { return true; } : + function( elem ) { + return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; + }; + }, + + "CLASS": function( className ) { + var pattern = classCache[ className + " " ]; + + return pattern || + (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) && + classCache( className, function( elem ) { + return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "" ); + }); + }, + + "ATTR": function( name, operator, check ) { + return function( elem ) { + var result = Sizzle.attr( elem, name ); + + if ( result == null ) { + return operator === "!="; + } + if ( !operator ) { + return true; + } + + result += ""; + + return operator === "=" ? result === check : + operator === "!=" ? result !== check : + operator === "^=" ? check && result.indexOf( check ) === 0 : + operator === "*=" ? check && result.indexOf( check ) > -1 : + operator === "$=" ? check && result.slice( -check.length ) === check : + operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 : + operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : + false; + }; + }, + + "CHILD": function( type, what, argument, first, last ) { + var simple = type.slice( 0, 3 ) !== "nth", + forward = type.slice( -4 ) !== "last", + ofType = what === "of-type"; + + return first === 1 && last === 0 ? + + // Shortcut for :nth-*(n) + function( elem ) { + return !!elem.parentNode; + } : + + function( elem, context, xml ) { + var cache, uniqueCache, outerCache, node, nodeIndex, start, + dir = simple !== forward ? "nextSibling" : "previousSibling", + parent = elem.parentNode, + name = ofType && elem.nodeName.toLowerCase(), + useCache = !xml && !ofType, + diff = false; + + if ( parent ) { + + // :(first|last|only)-(child|of-type) + if ( simple ) { + while ( dir ) { + node = elem; + while ( (node = node[ dir ]) ) { + if ( ofType ? + node.nodeName.toLowerCase() === name : + node.nodeType === 1 ) { + + return false; + } + } + // Reverse direction for :only-* (if we haven't yet done so) + start = dir = type === "only" && !start && "nextSibling"; + } + return true; + } + + start = [ forward ? parent.firstChild : parent.lastChild ]; + + // non-xml :nth-child(...) stores cache data on `parent` + if ( forward && useCache ) { + + // Seek `elem` from a previously-cached index + + // ...in a gzip-friendly way + node = parent; + outerCache = node[ expando ] || (node[ expando ] = {}); + + // Support: IE <9 only + // Defend against cloned attroperties (jQuery gh-1709) + uniqueCache = outerCache[ node.uniqueID ] || + (outerCache[ node.uniqueID ] = {}); + + cache = uniqueCache[ type ] || []; + nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; + diff = nodeIndex && cache[ 2 ]; + node = nodeIndex && parent.childNodes[ nodeIndex ]; + + while ( (node = ++nodeIndex && node && node[ dir ] || + + // Fallback to seeking `elem` from the start + (diff = nodeIndex = 0) || start.pop()) ) { + + // When found, cache indexes on `parent` and break + if ( node.nodeType === 1 && ++diff && node === elem ) { + uniqueCache[ type ] = [ dirruns, nodeIndex, diff ]; + break; + } + } + + } else { + // Use previously-cached element index if available + if ( useCache ) { + // ...in a gzip-friendly way + node = elem; + outerCache = node[ expando ] || (node[ expando ] = {}); + + // Support: IE <9 only + // Defend against cloned attroperties (jQuery gh-1709) + uniqueCache = outerCache[ node.uniqueID ] || + (outerCache[ node.uniqueID ] = {}); + + cache = uniqueCache[ type ] || []; + nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; + diff = nodeIndex; + } + + // xml :nth-child(...) + // or :nth-last-child(...) or :nth(-last)?-of-type(...) + if ( diff === false ) { + // Use the same loop as above to seek `elem` from the start + while ( (node = ++nodeIndex && node && node[ dir ] || + (diff = nodeIndex = 0) || start.pop()) ) { + + if ( ( ofType ? + node.nodeName.toLowerCase() === name : + node.nodeType === 1 ) && + ++diff ) { + + // Cache the index of each encountered element + if ( useCache ) { + outerCache = node[ expando ] || (node[ expando ] = {}); + + // Support: IE <9 only + // Defend against cloned attroperties (jQuery gh-1709) + uniqueCache = outerCache[ node.uniqueID ] || + (outerCache[ node.uniqueID ] = {}); + + uniqueCache[ type ] = [ dirruns, diff ]; + } + + if ( node === elem ) { + break; + } + } + } + } + } + + // Incorporate the offset, then check against cycle size + diff -= last; + return diff === first || ( diff % first === 0 && diff / first >= 0 ); + } + }; + }, + + "PSEUDO": function( pseudo, argument ) { + // pseudo-class names are case-insensitive + // http://www.w3.org/TR/selectors/#pseudo-classes + // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters + // Remember that setFilters inherits from pseudos + var args, + fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || + Sizzle.error( "unsupported pseudo: " + pseudo ); + + // The user may use createPseudo to indicate that + // arguments are needed to create the filter function + // just as Sizzle does + if ( fn[ expando ] ) { + return fn( argument ); + } + + // But maintain support for old signatures + if ( fn.length > 1 ) { + args = [ pseudo, pseudo, "", argument ]; + return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? + markFunction(function( seed, matches ) { + var idx, + matched = fn( seed, argument ), + i = matched.length; + while ( i-- ) { + idx = indexOf( seed, matched[i] ); + seed[ idx ] = !( matches[ idx ] = matched[i] ); + } + }) : + function( elem ) { + return fn( elem, 0, args ); + }; + } + + return fn; + } + }, + + pseudos: { + // Potentially complex pseudos + "not": markFunction(function( selector ) { + // Trim the selector passed to compile + // to avoid treating leading and trailing + // spaces as combinators + var input = [], + results = [], + matcher = compile( selector.replace( rtrim, "$1" ) ); + + return matcher[ expando ] ? + markFunction(function( seed, matches, context, xml ) { + var elem, + unmatched = matcher( seed, null, xml, [] ), + i = seed.length; + + // Match elements unmatched by `matcher` + while ( i-- ) { + if ( (elem = unmatched[i]) ) { + seed[i] = !(matches[i] = elem); + } + } + }) : + function( elem, context, xml ) { + input[0] = elem; + matcher( input, null, xml, results ); + // Don't keep the element (issue #299) + input[0] = null; + return !results.pop(); + }; + }), + + "has": markFunction(function( selector ) { + return function( elem ) { + return Sizzle( selector, elem ).length > 0; + }; + }), + + "contains": markFunction(function( text ) { + text = text.replace( runescape, funescape ); + return function( elem ) { + return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1; + }; + }), + + // "Whether an element is represented by a :lang() selector + // is based solely on the element's language value + // being equal to the identifier C, + // or beginning with the identifier C immediately followed by "-". + // The matching of C against the element's language value is performed case-insensitively. + // The identifier C does not have to be a valid language name." + // http://www.w3.org/TR/selectors/#lang-pseudo + "lang": markFunction( function( lang ) { + // lang value must be a valid identifier + if ( !ridentifier.test(lang || "") ) { + Sizzle.error( "unsupported lang: " + lang ); + } + lang = lang.replace( runescape, funescape ).toLowerCase(); + return function( elem ) { + var elemLang; + do { + if ( (elemLang = documentIsHTML ? + elem.lang : + elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) { + + elemLang = elemLang.toLowerCase(); + return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; + } + } while ( (elem = elem.parentNode) && elem.nodeType === 1 ); + return false; + }; + }), + + // Miscellaneous + "target": function( elem ) { + var hash = window.location && window.location.hash; + return hash && hash.slice( 1 ) === elem.id; + }, + + "root": function( elem ) { + return elem === docElem; + }, + + "focus": function( elem ) { + return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex); + }, + + // Boolean properties + "enabled": function( elem ) { + return elem.disabled === false; + }, + + "disabled": function( elem ) { + return elem.disabled === true; + }, + + "checked": function( elem ) { + // In CSS3, :checked should return both checked and selected elements + // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked + var nodeName = elem.nodeName.toLowerCase(); + return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected); + }, + + "selected": function( elem ) { + // Accessing this property makes selected-by-default + // options in Safari work properly + if ( elem.parentNode ) { + elem.parentNode.selectedIndex; + } + + return elem.selected === true; + }, + + // Contents + "empty": function( elem ) { + // http://www.w3.org/TR/selectors/#empty-pseudo + // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5), + // but not by others (comment: 8; processing instruction: 7; etc.) + // nodeType < 6 works because attributes (2) do not appear as children + for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { + if ( elem.nodeType < 6 ) { + return false; + } + } + return true; + }, + + "parent": function( elem ) { + return !Expr.pseudos["empty"]( elem ); + }, + + // Element/input types + "header": function( elem ) { + return rheader.test( elem.nodeName ); + }, + + "input": function( elem ) { + return rinputs.test( elem.nodeName ); + }, + + "button": function( elem ) { + var name = elem.nodeName.toLowerCase(); + return name === "input" && elem.type === "button" || name === "button"; + }, + + "text": function( elem ) { + var attr; + return elem.nodeName.toLowerCase() === "input" && + elem.type === "text" && + + // Support: IE<8 + // New HTML5 attribute values (e.g., "search") appear with elem.type === "text" + ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" ); + }, + + // Position-in-collection + "first": createPositionalPseudo(function() { + return [ 0 ]; + }), + + "last": createPositionalPseudo(function( matchIndexes, length ) { + return [ length - 1 ]; + }), + + "eq": createPositionalPseudo(function( matchIndexes, length, argument ) { + return [ argument < 0 ? argument + length : argument ]; + }), + + "even": createPositionalPseudo(function( matchIndexes, length ) { + var i = 0; + for ( ; i < length; i += 2 ) { + matchIndexes.push( i ); + } + return matchIndexes; + }), + + "odd": createPositionalPseudo(function( matchIndexes, length ) { + var i = 1; + for ( ; i < length; i += 2 ) { + matchIndexes.push( i ); + } + return matchIndexes; + }), + + "lt": createPositionalPseudo(function( matchIndexes, length, argument ) { + var i = argument < 0 ? argument + length : argument; + for ( ; --i >= 0; ) { + matchIndexes.push( i ); + } + return matchIndexes; + }), + + "gt": createPositionalPseudo(function( matchIndexes, length, argument ) { + var i = argument < 0 ? argument + length : argument; + for ( ; ++i < length; ) { + matchIndexes.push( i ); + } + return matchIndexes; + }) + } +}; + +Expr.pseudos["nth"] = Expr.pseudos["eq"]; + +// Add button/input type pseudos +for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { + Expr.pseudos[ i ] = createInputPseudo( i ); +} +for ( i in { submit: true, reset: true } ) { + Expr.pseudos[ i ] = createButtonPseudo( i ); +} + +// Easy API for creating new setFilters +function setFilters() {} +setFilters.prototype = Expr.filters = Expr.pseudos; +Expr.setFilters = new setFilters(); + +tokenize = Sizzle.tokenize = function( selector, parseOnly ) { + var matched, match, tokens, type, + soFar, groups, preFilters, + cached = tokenCache[ selector + " " ]; + + if ( cached ) { + return parseOnly ? 0 : cached.slice( 0 ); + } + + soFar = selector; + groups = []; + preFilters = Expr.preFilter; + + while ( soFar ) { + + // Comma and first run + if ( !matched || (match = rcomma.exec( soFar )) ) { + if ( match ) { + // Don't consume trailing commas as valid + soFar = soFar.slice( match[0].length ) || soFar; + } + groups.push( (tokens = []) ); + } + + matched = false; + + // Combinators + if ( (match = rcombinators.exec( soFar )) ) { + matched = match.shift(); + tokens.push({ + value: matched, + // Cast descendant combinators to space + type: match[0].replace( rtrim, " " ) + }); + soFar = soFar.slice( matched.length ); + } + + // Filters + for ( type in Expr.filter ) { + if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] || + (match = preFilters[ type ]( match ))) ) { + matched = match.shift(); + tokens.push({ + value: matched, + type: type, + matches: match + }); + soFar = soFar.slice( matched.length ); + } + } + + if ( !matched ) { + break; + } + } + + // Return the length of the invalid excess + // if we're just parsing + // Otherwise, throw an error or return tokens + return parseOnly ? + soFar.length : + soFar ? + Sizzle.error( selector ) : + // Cache the tokens + tokenCache( selector, groups ).slice( 0 ); +}; + +function toSelector( tokens ) { + var i = 0, + len = tokens.length, + selector = ""; + for ( ; i < len; i++ ) { + selector += tokens[i].value; + } + return selector; +} + +function addCombinator( matcher, combinator, base ) { + var dir = combinator.dir, + checkNonElements = base && dir === "parentNode", + doneName = done++; + + return combinator.first ? + // Check against closest ancestor/preceding element + function( elem, context, xml ) { + while ( (elem = elem[ dir ]) ) { + if ( elem.nodeType === 1 || checkNonElements ) { + return matcher( elem, context, xml ); + } + } + } : + + // Check against all ancestor/preceding elements + function( elem, context, xml ) { + var oldCache, uniqueCache, outerCache, + newCache = [ dirruns, doneName ]; + + // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching + if ( xml ) { + while ( (elem = elem[ dir ]) ) { + if ( elem.nodeType === 1 || checkNonElements ) { + if ( matcher( elem, context, xml ) ) { + return true; + } + } + } + } else { + while ( (elem = elem[ dir ]) ) { + if ( elem.nodeType === 1 || checkNonElements ) { + outerCache = elem[ expando ] || (elem[ expando ] = {}); + + // Support: IE <9 only + // Defend against cloned attroperties (jQuery gh-1709) + uniqueCache = outerCache[ elem.uniqueID ] || (outerCache[ elem.uniqueID ] = {}); + + if ( (oldCache = uniqueCache[ dir ]) && + oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) { + + // Assign to newCache so results back-propagate to previous elements + return (newCache[ 2 ] = oldCache[ 2 ]); + } else { + // Reuse newcache so results back-propagate to previous elements + uniqueCache[ dir ] = newCache; + + // A match means we're done; a fail means we have to keep checking + if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) { + return true; + } + } + } + } + } + }; +} + +function elementMatcher( matchers ) { + return matchers.length > 1 ? + function( elem, context, xml ) { + var i = matchers.length; + while ( i-- ) { + if ( !matchers[i]( elem, context, xml ) ) { + return false; + } + } + return true; + } : + matchers[0]; +} + +function multipleContexts( selector, contexts, results ) { + var i = 0, + len = contexts.length; + for ( ; i < len; i++ ) { + Sizzle( selector, contexts[i], results ); + } + return results; +} + +function condense( unmatched, map, filter, context, xml ) { + var elem, + newUnmatched = [], + i = 0, + len = unmatched.length, + mapped = map != null; + + for ( ; i < len; i++ ) { + if ( (elem = unmatched[i]) ) { + if ( !filter || filter( elem, context, xml ) ) { + newUnmatched.push( elem ); + if ( mapped ) { + map.push( i ); + } + } + } + } + + return newUnmatched; +} + +function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { + if ( postFilter && !postFilter[ expando ] ) { + postFilter = setMatcher( postFilter ); + } + if ( postFinder && !postFinder[ expando ] ) { + postFinder = setMatcher( postFinder, postSelector ); + } + return markFunction(function( seed, results, context, xml ) { + var temp, i, elem, + preMap = [], + postMap = [], + preexisting = results.length, + + // Get initial elements from seed or context + elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ), + + // Prefilter to get matcher input, preserving a map for seed-results synchronization + matcherIn = preFilter && ( seed || !selector ) ? + condense( elems, preMap, preFilter, context, xml ) : + elems, + + matcherOut = matcher ? + // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, + postFinder || ( seed ? preFilter : preexisting || postFilter ) ? + + // ...intermediate processing is necessary + [] : + + // ...otherwise use results directly + results : + matcherIn; + + // Find primary matches + if ( matcher ) { + matcher( matcherIn, matcherOut, context, xml ); + } + + // Apply postFilter + if ( postFilter ) { + temp = condense( matcherOut, postMap ); + postFilter( temp, [], context, xml ); + + // Un-match failing elements by moving them back to matcherIn + i = temp.length; + while ( i-- ) { + if ( (elem = temp[i]) ) { + matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem); + } + } + } + + if ( seed ) { + if ( postFinder || preFilter ) { + if ( postFinder ) { + // Get the final matcherOut by condensing this intermediate into postFinder contexts + temp = []; + i = matcherOut.length; + while ( i-- ) { + if ( (elem = matcherOut[i]) ) { + // Restore matcherIn since elem is not yet a final match + temp.push( (matcherIn[i] = elem) ); + } + } + postFinder( null, (matcherOut = []), temp, xml ); + } + + // Move matched elements from seed to results to keep them synchronized + i = matcherOut.length; + while ( i-- ) { + if ( (elem = matcherOut[i]) && + (temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) { + + seed[temp] = !(results[temp] = elem); + } + } + } + + // Add elements to results, through postFinder if defined + } else { + matcherOut = condense( + matcherOut === results ? + matcherOut.splice( preexisting, matcherOut.length ) : + matcherOut + ); + if ( postFinder ) { + postFinder( null, results, matcherOut, xml ); + } else { + push.apply( results, matcherOut ); + } + } + }); +} + +function matcherFromTokens( tokens ) { + var checkContext, matcher, j, + len = tokens.length, + leadingRelative = Expr.relative[ tokens[0].type ], + implicitRelative = leadingRelative || Expr.relative[" "], + i = leadingRelative ? 1 : 0, + + // The foundational matcher ensures that elements are reachable from top-level context(s) + matchContext = addCombinator( function( elem ) { + return elem === checkContext; + }, implicitRelative, true ), + matchAnyContext = addCombinator( function( elem ) { + return indexOf( checkContext, elem ) > -1; + }, implicitRelative, true ), + matchers = [ function( elem, context, xml ) { + var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( + (checkContext = context).nodeType ? + matchContext( elem, context, xml ) : + matchAnyContext( elem, context, xml ) ); + // Avoid hanging onto element (issue #299) + checkContext = null; + return ret; + } ]; + + for ( ; i < len; i++ ) { + if ( (matcher = Expr.relative[ tokens[i].type ]) ) { + matchers = [ addCombinator(elementMatcher( matchers ), matcher) ]; + } else { + matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches ); + + // Return special upon seeing a positional matcher + if ( matcher[ expando ] ) { + // Find the next relative operator (if any) for proper handling + j = ++i; + for ( ; j < len; j++ ) { + if ( Expr.relative[ tokens[j].type ] ) { + break; + } + } + return setMatcher( + i > 1 && elementMatcher( matchers ), + i > 1 && toSelector( + // If the preceding token was a descendant combinator, insert an implicit any-element `*` + tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" }) + ).replace( rtrim, "$1" ), + matcher, + i < j && matcherFromTokens( tokens.slice( i, j ) ), + j < len && matcherFromTokens( (tokens = tokens.slice( j )) ), + j < len && toSelector( tokens ) + ); + } + matchers.push( matcher ); + } + } + + return elementMatcher( matchers ); +} + +function matcherFromGroupMatchers( elementMatchers, setMatchers ) { + var bySet = setMatchers.length > 0, + byElement = elementMatchers.length > 0, + superMatcher = function( seed, context, xml, results, outermost ) { + var elem, j, matcher, + matchedCount = 0, + i = "0", + unmatched = seed && [], + setMatched = [], + contextBackup = outermostContext, + // We must always have either seed elements or outermost context + elems = seed || byElement && Expr.find["TAG"]( "*", outermost ), + // Use integer dirruns iff this is the outermost matcher + dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1), + len = elems.length; + + if ( outermost ) { + outermostContext = context === document || context || outermost; + } + + // Add elements passing elementMatchers directly to results + // Support: IE<9, Safari + // Tolerate NodeList properties (IE: "length"; Safari: ) matching elements by id + for ( ; i !== len && (elem = elems[i]) != null; i++ ) { + if ( byElement && elem ) { + j = 0; + if ( !context && elem.ownerDocument !== document ) { + setDocument( elem ); + xml = !documentIsHTML; + } + while ( (matcher = elementMatchers[j++]) ) { + if ( matcher( elem, context || document, xml) ) { + results.push( elem ); + break; + } + } + if ( outermost ) { + dirruns = dirrunsUnique; + } + } + + // Track unmatched elements for set filters + if ( bySet ) { + // They will have gone through all possible matchers + if ( (elem = !matcher && elem) ) { + matchedCount--; + } + + // Lengthen the array for every element, matched or not + if ( seed ) { + unmatched.push( elem ); + } + } + } + + // `i` is now the count of elements visited above, and adding it to `matchedCount` + // makes the latter nonnegative. + matchedCount += i; + + // Apply set filters to unmatched elements + // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount` + // equals `i`), unless we didn't visit _any_ elements in the above loop because we have + // no element matchers and no seed. + // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that + // case, which will result in a "00" `matchedCount` that differs from `i` but is also + // numerically zero. + if ( bySet && i !== matchedCount ) { + j = 0; + while ( (matcher = setMatchers[j++]) ) { + matcher( unmatched, setMatched, context, xml ); + } + + if ( seed ) { + // Reintegrate element matches to eliminate the need for sorting + if ( matchedCount > 0 ) { + while ( i-- ) { + if ( !(unmatched[i] || setMatched[i]) ) { + setMatched[i] = pop.call( results ); + } + } + } + + // Discard index placeholder values to get only actual matches + setMatched = condense( setMatched ); + } + + // Add matches to results + push.apply( results, setMatched ); + + // Seedless set matches succeeding multiple successful matchers stipulate sorting + if ( outermost && !seed && setMatched.length > 0 && + ( matchedCount + setMatchers.length ) > 1 ) { + + Sizzle.uniqueSort( results ); + } + } + + // Override manipulation of globals by nested matchers + if ( outermost ) { + dirruns = dirrunsUnique; + outermostContext = contextBackup; + } + + return unmatched; + }; + + return bySet ? + markFunction( superMatcher ) : + superMatcher; +} + +compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) { + var i, + setMatchers = [], + elementMatchers = [], + cached = compilerCache[ selector + " " ]; + + if ( !cached ) { + // Generate a function of recursive functions that can be used to check each element + if ( !match ) { + match = tokenize( selector ); + } + i = match.length; + while ( i-- ) { + cached = matcherFromTokens( match[i] ); + if ( cached[ expando ] ) { + setMatchers.push( cached ); + } else { + elementMatchers.push( cached ); + } + } + + // Cache the compiled function + cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) ); + + // Save selector and tokenization + cached.selector = selector; + } + return cached; +}; + +/** + * A low-level selection function that works with Sizzle's compiled + * selector functions + * @param {String|Function} selector A selector or a pre-compiled + * selector function built with Sizzle.compile + * @param {Element} context + * @param {Array} [results] + * @param {Array} [seed] A set of elements to match against + */ +select = Sizzle.select = function( selector, context, results, seed ) { + var i, tokens, token, type, find, + compiled = typeof selector === "function" && selector, + match = !seed && tokenize( (selector = compiled.selector || selector) ); + + results = results || []; + + // Try to minimize operations if there is only one selector in the list and no seed + // (the latter of which guarantees us context) + if ( match.length === 1 ) { + + // Reduce context if the leading compound selector is an ID + tokens = match[0] = match[0].slice( 0 ); + if ( tokens.length > 2 && (token = tokens[0]).type === "ID" && + support.getById && context.nodeType === 9 && documentIsHTML && + Expr.relative[ tokens[1].type ] ) { + + context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0]; + if ( !context ) { + return results; + + // Precompiled matchers will still verify ancestry, so step up a level + } else if ( compiled ) { + context = context.parentNode; + } + + selector = selector.slice( tokens.shift().value.length ); + } + + // Fetch a seed set for right-to-left matching + i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length; + while ( i-- ) { + token = tokens[i]; + + // Abort if we hit a combinator + if ( Expr.relative[ (type = token.type) ] ) { + break; + } + if ( (find = Expr.find[ type ]) ) { + // Search, expanding context for leading sibling combinators + if ( (seed = find( + token.matches[0].replace( runescape, funescape ), + rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context + )) ) { + + // If seed is empty or no tokens remain, we can return early + tokens.splice( i, 1 ); + selector = seed.length && toSelector( tokens ); + if ( !selector ) { + push.apply( results, seed ); + return results; + } + + break; + } + } + } + } + + // Compile and execute a filtering function if one is not provided + // Provide `match` to avoid retokenization if we modified the selector above + ( compiled || compile( selector, match ) )( + seed, + context, + !documentIsHTML, + results, + !context || rsibling.test( selector ) && testContext( context.parentNode ) || context + ); + return results; +}; + +// One-time assignments + +// Sort stability +support.sortStable = expando.split("").sort( sortOrder ).join("") === expando; + +// Support: Chrome 14-35+ +// Always assume duplicates if they aren't passed to the comparison function +support.detectDuplicates = !!hasDuplicate; + +// Initialize against the default document +setDocument(); + +// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27) +// Detached nodes confoundingly follow *each other* +support.sortDetached = assert(function( div1 ) { + // Should return 1, but returns 4 (following) + return div1.compareDocumentPosition( document.createElement("div") ) & 1; +}); + +// Support: IE<8 +// Prevent attribute/property "interpolation" +// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx +if ( !assert(function( div ) { + div.innerHTML = ""; + return div.firstChild.getAttribute("href") === "#" ; +}) ) { + addHandle( "type|href|height|width", function( elem, name, isXML ) { + if ( !isXML ) { + return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 ); + } + }); +} + +// Support: IE<9 +// Use defaultValue in place of getAttribute("value") +if ( !support.attributes || !assert(function( div ) { + div.innerHTML = ""; + div.firstChild.setAttribute( "value", "" ); + return div.firstChild.getAttribute( "value" ) === ""; +}) ) { + addHandle( "value", function( elem, name, isXML ) { + if ( !isXML && elem.nodeName.toLowerCase() === "input" ) { + return elem.defaultValue; + } + }); +} + +// Support: IE<9 +// Use getAttributeNode to fetch booleans when getAttribute lies +if ( !assert(function( div ) { + return div.getAttribute("disabled") == null; +}) ) { + addHandle( booleans, function( elem, name, isXML ) { + var val; + if ( !isXML ) { + return elem[ name ] === true ? name.toLowerCase() : + (val = elem.getAttributeNode( name )) && val.specified ? + val.value : + null; + } + }); +} + +return Sizzle; + +})( window ); + + + +jQuery.find = Sizzle; +jQuery.expr = Sizzle.selectors; +jQuery.expr[ ":" ] = jQuery.expr.pseudos; +jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort; +jQuery.text = Sizzle.getText; +jQuery.isXMLDoc = Sizzle.isXML; +jQuery.contains = Sizzle.contains; + + + +var dir = function( elem, dir, until ) { + var matched = [], + truncate = until !== undefined; + + while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) { + if ( elem.nodeType === 1 ) { + if ( truncate && jQuery( elem ).is( until ) ) { + break; + } + matched.push( elem ); + } + } + return matched; +}; + + +var siblings = function( n, elem ) { + var matched = []; + + for ( ; n; n = n.nextSibling ) { + if ( n.nodeType === 1 && n !== elem ) { + matched.push( n ); + } + } + + return matched; +}; + + +var rneedsContext = jQuery.expr.match.needsContext; + +var rsingleTag = ( /^<([\w-]+)\s*\/?>(?:<\/\1>|)$/ ); + + + +var risSimple = /^.[^:#\[\.,]*$/; + +// Implement the identical functionality for filter and not +function winnow( elements, qualifier, not ) { + if ( jQuery.isFunction( qualifier ) ) { + return jQuery.grep( elements, function( elem, i ) { + /* jshint -W018 */ + return !!qualifier.call( elem, i, elem ) !== not; + } ); + + } + + if ( qualifier.nodeType ) { + return jQuery.grep( elements, function( elem ) { + return ( elem === qualifier ) !== not; + } ); + + } + + if ( typeof qualifier === "string" ) { + if ( risSimple.test( qualifier ) ) { + return jQuery.filter( qualifier, elements, not ); + } + + qualifier = jQuery.filter( qualifier, elements ); + } + + return jQuery.grep( elements, function( elem ) { + return ( jQuery.inArray( elem, qualifier ) > -1 ) !== not; + } ); +} + +jQuery.filter = function( expr, elems, not ) { + var elem = elems[ 0 ]; + + if ( not ) { + expr = ":not(" + expr + ")"; + } + + return elems.length === 1 && elem.nodeType === 1 ? + jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] : + jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { + return elem.nodeType === 1; + } ) ); +}; + +jQuery.fn.extend( { + find: function( selector ) { + var i, + ret = [], + self = this, + len = self.length; + + if ( typeof selector !== "string" ) { + return this.pushStack( jQuery( selector ).filter( function() { + for ( i = 0; i < len; i++ ) { + if ( jQuery.contains( self[ i ], this ) ) { + return true; + } + } + } ) ); + } + + for ( i = 0; i < len; i++ ) { + jQuery.find( selector, self[ i ], ret ); + } + + // Needed because $( selector, context ) becomes $( context ).find( selector ) + ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret ); + ret.selector = this.selector ? this.selector + " " + selector : selector; + return ret; + }, + filter: function( selector ) { + return this.pushStack( winnow( this, selector || [], false ) ); + }, + not: function( selector ) { + return this.pushStack( winnow( this, selector || [], true ) ); + }, + is: function( selector ) { + return !!winnow( + this, + + // If this is a positional/relative selector, check membership in the returned set + // so $("p:first").is("p:last") won't return true for a doc with two "p". + typeof selector === "string" && rneedsContext.test( selector ) ? + jQuery( selector ) : + selector || [], + false + ).length; + } +} ); + + +// Initialize a jQuery object + + +// A central reference to the root jQuery(document) +var rootjQuery, + + // A simple way to check for HTML strings + // Prioritize #id over to avoid XSS via location.hash (#9521) + // Strict HTML recognition (#11290: must start with <) + rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/, + + init = jQuery.fn.init = function( selector, context, root ) { + var match, elem; + + // HANDLE: $(""), $(null), $(undefined), $(false) + if ( !selector ) { + return this; + } + + // init accepts an alternate rootjQuery + // so migrate can support jQuery.sub (gh-2101) + root = root || rootjQuery; + + // Handle HTML strings + if ( typeof selector === "string" ) { + if ( selector.charAt( 0 ) === "<" && + selector.charAt( selector.length - 1 ) === ">" && + selector.length >= 3 ) { + + // Assume that strings that start and end with <> are HTML and skip the regex check + match = [ null, selector, null ]; + + } else { + match = rquickExpr.exec( selector ); + } + + // Match html or make sure no context is specified for #id + if ( match && ( match[ 1 ] || !context ) ) { + + // HANDLE: $(html) -> $(array) + if ( match[ 1 ] ) { + context = context instanceof jQuery ? context[ 0 ] : context; + + // scripts is true for back-compat + // Intentionally let the error be thrown if parseHTML is not present + jQuery.merge( this, jQuery.parseHTML( + match[ 1 ], + context && context.nodeType ? context.ownerDocument || context : document, + true + ) ); + + // HANDLE: $(html, props) + if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) { + for ( match in context ) { + + // Properties of context are called as methods if possible + if ( jQuery.isFunction( this[ match ] ) ) { + this[ match ]( context[ match ] ); + + // ...and otherwise set as attributes + } else { + this.attr( match, context[ match ] ); + } + } + } + + return this; + + // HANDLE: $(#id) + } else { + elem = document.getElementById( match[ 2 ] ); + + // Check parentNode to catch when Blackberry 4.6 returns + // nodes that are no longer in the document #6963 + if ( elem && elem.parentNode ) { + + // Handle the case where IE and Opera return items + // by name instead of ID + if ( elem.id !== match[ 2 ] ) { + return rootjQuery.find( selector ); + } + + // Otherwise, we inject the element directly into the jQuery object + this.length = 1; + this[ 0 ] = elem; + } + + this.context = document; + this.selector = selector; + return this; + } + + // HANDLE: $(expr, $(...)) + } else if ( !context || context.jquery ) { + return ( context || root ).find( selector ); + + // HANDLE: $(expr, context) + // (which is just equivalent to: $(context).find(expr) + } else { + return this.constructor( context ).find( selector ); + } + + // HANDLE: $(DOMElement) + } else if ( selector.nodeType ) { + this.context = this[ 0 ] = selector; + this.length = 1; + return this; + + // HANDLE: $(function) + // Shortcut for document ready + } else if ( jQuery.isFunction( selector ) ) { + return typeof root.ready !== "undefined" ? + root.ready( selector ) : + + // Execute immediately if ready is not present + selector( jQuery ); + } + + if ( selector.selector !== undefined ) { + this.selector = selector.selector; + this.context = selector.context; + } + + return jQuery.makeArray( selector, this ); + }; + +// Give the init function the jQuery prototype for later instantiation +init.prototype = jQuery.fn; + +// Initialize central reference +rootjQuery = jQuery( document ); + + +var rparentsprev = /^(?:parents|prev(?:Until|All))/, + + // methods guaranteed to produce a unique set when starting from a unique set + guaranteedUnique = { + children: true, + contents: true, + next: true, + prev: true + }; + +jQuery.fn.extend( { + has: function( target ) { + var i, + targets = jQuery( target, this ), + len = targets.length; + + return this.filter( function() { + for ( i = 0; i < len; i++ ) { + if ( jQuery.contains( this, targets[ i ] ) ) { + return true; + } + } + } ); + }, + + closest: function( selectors, context ) { + var cur, + i = 0, + l = this.length, + matched = [], + pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ? + jQuery( selectors, context || this.context ) : + 0; + + for ( ; i < l; i++ ) { + for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) { + + // Always skip document fragments + if ( cur.nodeType < 11 && ( pos ? + pos.index( cur ) > -1 : + + // Don't pass non-elements to Sizzle + cur.nodeType === 1 && + jQuery.find.matchesSelector( cur, selectors ) ) ) { + + matched.push( cur ); + break; + } + } + } + + return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched ); + }, + + // Determine the position of an element within + // the matched set of elements + index: function( elem ) { + + // No argument, return index in parent + if ( !elem ) { + return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1; + } + + // index in selector + if ( typeof elem === "string" ) { + return jQuery.inArray( this[ 0 ], jQuery( elem ) ); + } + + // Locate the position of the desired element + return jQuery.inArray( + + // If it receives a jQuery object, the first element is used + elem.jquery ? elem[ 0 ] : elem, this ); + }, + + add: function( selector, context ) { + return this.pushStack( + jQuery.uniqueSort( + jQuery.merge( this.get(), jQuery( selector, context ) ) + ) + ); + }, + + addBack: function( selector ) { + return this.add( selector == null ? + this.prevObject : this.prevObject.filter( selector ) + ); + } +} ); + +function sibling( cur, dir ) { + do { + cur = cur[ dir ]; + } while ( cur && cur.nodeType !== 1 ); + + return cur; +} + +jQuery.each( { + parent: function( elem ) { + var parent = elem.parentNode; + return parent && parent.nodeType !== 11 ? parent : null; + }, + parents: function( elem ) { + return dir( elem, "parentNode" ); + }, + parentsUntil: function( elem, i, until ) { + return dir( elem, "parentNode", until ); + }, + next: function( elem ) { + return sibling( elem, "nextSibling" ); + }, + prev: function( elem ) { + return sibling( elem, "previousSibling" ); + }, + nextAll: function( elem ) { + return dir( elem, "nextSibling" ); + }, + prevAll: function( elem ) { + return dir( elem, "previousSibling" ); + }, + nextUntil: function( elem, i, until ) { + return dir( elem, "nextSibling", until ); + }, + prevUntil: function( elem, i, until ) { + return dir( elem, "previousSibling", until ); + }, + siblings: function( elem ) { + return siblings( ( elem.parentNode || {} ).firstChild, elem ); + }, + children: function( elem ) { + return siblings( elem.firstChild ); + }, + contents: function( elem ) { + return jQuery.nodeName( elem, "iframe" ) ? + elem.contentDocument || elem.contentWindow.document : + jQuery.merge( [], elem.childNodes ); + } +}, function( name, fn ) { + jQuery.fn[ name ] = function( until, selector ) { + var ret = jQuery.map( this, fn, until ); + + if ( name.slice( -5 ) !== "Until" ) { + selector = until; + } + + if ( selector && typeof selector === "string" ) { + ret = jQuery.filter( selector, ret ); + } + + if ( this.length > 1 ) { + + // Remove duplicates + if ( !guaranteedUnique[ name ] ) { + ret = jQuery.uniqueSort( ret ); + } + + // Reverse order for parents* and prev-derivatives + if ( rparentsprev.test( name ) ) { + ret = ret.reverse(); + } + } + + return this.pushStack( ret ); + }; +} ); +var rnotwhite = ( /\S+/g ); + + + +// Convert String-formatted options into Object-formatted ones +function createOptions( options ) { + var object = {}; + jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) { + object[ flag ] = true; + } ); + return object; +} + +/* + * Create a callback list using the following parameters: + * + * options: an optional list of space-separated options that will change how + * the callback list behaves or a more traditional option object + * + * By default a callback list will act like an event callback list and can be + * "fired" multiple times. + * + * Possible options: + * + * once: will ensure the callback list can only be fired once (like a Deferred) + * + * memory: will keep track of previous values and will call any callback added + * after the list has been fired right away with the latest "memorized" + * values (like a Deferred) + * + * unique: will ensure a callback can only be added once (no duplicate in the list) + * + * stopOnFalse: interrupt callings when a callback returns false + * + */ +jQuery.Callbacks = function( options ) { + + // Convert options from String-formatted to Object-formatted if needed + // (we check in cache first) + options = typeof options === "string" ? + createOptions( options ) : + jQuery.extend( {}, options ); + + var // Flag to know if list is currently firing + firing, + + // Last fire value for non-forgettable lists + memory, + + // Flag to know if list was already fired + fired, + + // Flag to prevent firing + locked, + + // Actual callback list + list = [], + + // Queue of execution data for repeatable lists + queue = [], + + // Index of currently firing callback (modified by add/remove as needed) + firingIndex = -1, + + // Fire callbacks + fire = function() { + + // Enforce single-firing + locked = options.once; + + // Execute callbacks for all pending executions, + // respecting firingIndex overrides and runtime changes + fired = firing = true; + for ( ; queue.length; firingIndex = -1 ) { + memory = queue.shift(); + while ( ++firingIndex < list.length ) { + + // Run callback and check for early termination + if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false && + options.stopOnFalse ) { + + // Jump to end and forget the data so .add doesn't re-fire + firingIndex = list.length; + memory = false; + } + } + } + + // Forget the data if we're done with it + if ( !options.memory ) { + memory = false; + } + + firing = false; + + // Clean up if we're done firing for good + if ( locked ) { + + // Keep an empty list if we have data for future add calls + if ( memory ) { + list = []; + + // Otherwise, this object is spent + } else { + list = ""; + } + } + }, + + // Actual Callbacks object + self = { + + // Add a callback or a collection of callbacks to the list + add: function() { + if ( list ) { + + // If we have memory from a past run, we should fire after adding + if ( memory && !firing ) { + firingIndex = list.length - 1; + queue.push( memory ); + } + + ( function add( args ) { + jQuery.each( args, function( _, arg ) { + if ( jQuery.isFunction( arg ) ) { + if ( !options.unique || !self.has( arg ) ) { + list.push( arg ); + } + } else if ( arg && arg.length && jQuery.type( arg ) !== "string" ) { + + // Inspect recursively + add( arg ); + } + } ); + } )( arguments ); + + if ( memory && !firing ) { + fire(); + } + } + return this; + }, + + // Remove a callback from the list + remove: function() { + jQuery.each( arguments, function( _, arg ) { + var index; + while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { + list.splice( index, 1 ); + + // Handle firing indexes + if ( index <= firingIndex ) { + firingIndex--; + } + } + } ); + return this; + }, + + // Check if a given callback is in the list. + // If no argument is given, return whether or not list has callbacks attached. + has: function( fn ) { + return fn ? + jQuery.inArray( fn, list ) > -1 : + list.length > 0; + }, + + // Remove all callbacks from the list + empty: function() { + if ( list ) { + list = []; + } + return this; + }, + + // Disable .fire and .add + // Abort any current/pending executions + // Clear all callbacks and values + disable: function() { + locked = queue = []; + list = memory = ""; + return this; + }, + disabled: function() { + return !list; + }, + + // Disable .fire + // Also disable .add unless we have memory (since it would have no effect) + // Abort any pending executions + lock: function() { + locked = true; + if ( !memory ) { + self.disable(); + } + return this; + }, + locked: function() { + return !!locked; + }, + + // Call all callbacks with the given context and arguments + fireWith: function( context, args ) { + if ( !locked ) { + args = args || []; + args = [ context, args.slice ? args.slice() : args ]; + queue.push( args ); + if ( !firing ) { + fire(); + } + } + return this; + }, + + // Call all the callbacks with the given arguments + fire: function() { + self.fireWith( this, arguments ); + return this; + }, + + // To know if the callbacks have already been called at least once + fired: function() { + return !!fired; + } + }; + + return self; +}; + + +jQuery.extend( { + + Deferred: function( func ) { + var tuples = [ + + // action, add listener, listener list, final state + [ "resolve", "done", jQuery.Callbacks( "once memory" ), "resolved" ], + [ "reject", "fail", jQuery.Callbacks( "once memory" ), "rejected" ], + [ "notify", "progress", jQuery.Callbacks( "memory" ) ] + ], + state = "pending", + promise = { + state: function() { + return state; + }, + always: function() { + deferred.done( arguments ).fail( arguments ); + return this; + }, + then: function( /* fnDone, fnFail, fnProgress */ ) { + var fns = arguments; + return jQuery.Deferred( function( newDefer ) { + jQuery.each( tuples, function( i, tuple ) { + var fn = jQuery.isFunction( fns[ i ] ) && fns[ i ]; + + // deferred[ done | fail | progress ] for forwarding actions to newDefer + deferred[ tuple[ 1 ] ]( function() { + var returned = fn && fn.apply( this, arguments ); + if ( returned && jQuery.isFunction( returned.promise ) ) { + returned.promise() + .progress( newDefer.notify ) + .done( newDefer.resolve ) + .fail( newDefer.reject ); + } else { + newDefer[ tuple[ 0 ] + "With" ]( + this === promise ? newDefer.promise() : this, + fn ? [ returned ] : arguments + ); + } + } ); + } ); + fns = null; + } ).promise(); + }, + + // Get a promise for this deferred + // If obj is provided, the promise aspect is added to the object + promise: function( obj ) { + return obj != null ? jQuery.extend( obj, promise ) : promise; + } + }, + deferred = {}; + + // Keep pipe for back-compat + promise.pipe = promise.then; + + // Add list-specific methods + jQuery.each( tuples, function( i, tuple ) { + var list = tuple[ 2 ], + stateString = tuple[ 3 ]; + + // promise[ done | fail | progress ] = list.add + promise[ tuple[ 1 ] ] = list.add; + + // Handle state + if ( stateString ) { + list.add( function() { + + // state = [ resolved | rejected ] + state = stateString; + + // [ reject_list | resolve_list ].disable; progress_list.lock + }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock ); + } + + // deferred[ resolve | reject | notify ] + deferred[ tuple[ 0 ] ] = function() { + deferred[ tuple[ 0 ] + "With" ]( this === deferred ? promise : this, arguments ); + return this; + }; + deferred[ tuple[ 0 ] + "With" ] = list.fireWith; + } ); + + // Make the deferred a promise + promise.promise( deferred ); + + // Call given func if any + if ( func ) { + func.call( deferred, deferred ); + } + + // All done! + return deferred; + }, + + // Deferred helper + when: function( subordinate /* , ..., subordinateN */ ) { + var i = 0, + resolveValues = slice.call( arguments ), + length = resolveValues.length, + + // the count of uncompleted subordinates + remaining = length !== 1 || + ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0, + + // the master Deferred. + // If resolveValues consist of only a single Deferred, just use that. + deferred = remaining === 1 ? subordinate : jQuery.Deferred(), + + // Update function for both resolve and progress values + updateFunc = function( i, contexts, values ) { + return function( value ) { + contexts[ i ] = this; + values[ i ] = arguments.length > 1 ? slice.call( arguments ) : value; + if ( values === progressValues ) { + deferred.notifyWith( contexts, values ); + + } else if ( !( --remaining ) ) { + deferred.resolveWith( contexts, values ); + } + }; + }, + + progressValues, progressContexts, resolveContexts; + + // add listeners to Deferred subordinates; treat others as resolved + if ( length > 1 ) { + progressValues = new Array( length ); + progressContexts = new Array( length ); + resolveContexts = new Array( length ); + for ( ; i < length; i++ ) { + if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) { + resolveValues[ i ].promise() + .progress( updateFunc( i, progressContexts, progressValues ) ) + .done( updateFunc( i, resolveContexts, resolveValues ) ) + .fail( deferred.reject ); + } else { + --remaining; + } + } + } + + // if we're not waiting on anything, resolve the master + if ( !remaining ) { + deferred.resolveWith( resolveContexts, resolveValues ); + } + + return deferred.promise(); + } +} ); + + +// The deferred used on DOM ready +var readyList; + +jQuery.fn.ready = function( fn ) { + + // Add the callback + jQuery.ready.promise().done( fn ); + + return this; +}; + +jQuery.extend( { + + // Is the DOM ready to be used? Set to true once it occurs. + isReady: false, + + // A counter to track how many items to wait for before + // the ready event fires. See #6781 + readyWait: 1, + + // Hold (or release) the ready event + holdReady: function( hold ) { + if ( hold ) { + jQuery.readyWait++; + } else { + jQuery.ready( true ); + } + }, + + // Handle when the DOM is ready + ready: function( wait ) { + + // Abort if there are pending holds or we're already ready + if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { + return; + } + + // Remember that the DOM is ready + jQuery.isReady = true; + + // If a normal DOM Ready event fired, decrement, and wait if need be + if ( wait !== true && --jQuery.readyWait > 0 ) { + return; + } + + // If there are functions bound, to execute + readyList.resolveWith( document, [ jQuery ] ); + + // Trigger any bound ready events + if ( jQuery.fn.triggerHandler ) { + jQuery( document ).triggerHandler( "ready" ); + jQuery( document ).off( "ready" ); + } + } +} ); + +/** + * Clean-up method for dom ready events + */ +function detach() { + if ( document.addEventListener ) { + document.removeEventListener( "DOMContentLoaded", completed ); + window.removeEventListener( "load", completed ); + + } else { + document.detachEvent( "onreadystatechange", completed ); + window.detachEvent( "onload", completed ); + } +} + +/** + * The ready event handler and self cleanup method + */ +function completed() { + + // readyState === "complete" is good enough for us to call the dom ready in oldIE + if ( document.addEventListener || + window.event.type === "load" || + document.readyState === "complete" ) { + + detach(); + jQuery.ready(); + } +} + +jQuery.ready.promise = function( obj ) { + if ( !readyList ) { + + readyList = jQuery.Deferred(); + + // Catch cases where $(document).ready() is called + // after the browser event has already occurred. + // Support: IE6-10 + // Older IE sometimes signals "interactive" too soon + if ( document.readyState === "complete" || + ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) { + + // Handle it asynchronously to allow scripts the opportunity to delay ready + window.setTimeout( jQuery.ready ); + + // Standards-based browsers support DOMContentLoaded + } else if ( document.addEventListener ) { + + // Use the handy event callback + document.addEventListener( "DOMContentLoaded", completed ); + + // A fallback to window.onload, that will always work + window.addEventListener( "load", completed ); + + // If IE event model is used + } else { + + // Ensure firing before onload, maybe late but safe also for iframes + document.attachEvent( "onreadystatechange", completed ); + + // A fallback to window.onload, that will always work + window.attachEvent( "onload", completed ); + + // If IE and not a frame + // continually check to see if the document is ready + var top = false; + + try { + top = window.frameElement == null && document.documentElement; + } catch ( e ) {} + + if ( top && top.doScroll ) { + ( function doScrollCheck() { + if ( !jQuery.isReady ) { + + try { + + // Use the trick by Diego Perini + // http://javascript.nwbox.com/IEContentLoaded/ + top.doScroll( "left" ); + } catch ( e ) { + return window.setTimeout( doScrollCheck, 50 ); + } + + // detach all dom ready events + detach(); + + // and execute any waiting functions + jQuery.ready(); + } + } )(); + } + } + } + return readyList.promise( obj ); +}; + +// Kick off the DOM ready check even if the user does not +jQuery.ready.promise(); + + + + +// Support: IE<9 +// Iteration over object's inherited properties before its own +var i; +for ( i in jQuery( support ) ) { + break; +} +support.ownFirst = i === "0"; + +// Note: most support tests are defined in their respective modules. +// false until the test is run +support.inlineBlockNeedsLayout = false; + +// Execute ASAP in case we need to set body.style.zoom +jQuery( function() { + + // Minified: var a,b,c,d + var val, div, body, container; + + body = document.getElementsByTagName( "body" )[ 0 ]; + if ( !body || !body.style ) { + + // Return for frameset docs that don't have a body + return; + } + + // Setup + div = document.createElement( "div" ); + container = document.createElement( "div" ); + container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px"; + body.appendChild( container ).appendChild( div ); + + if ( typeof div.style.zoom !== "undefined" ) { + + // Support: IE<8 + // Check if natively block-level elements act like inline-block + // elements when setting their display to 'inline' and giving + // them layout + div.style.cssText = "display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1"; + + support.inlineBlockNeedsLayout = val = div.offsetWidth === 3; + if ( val ) { + + // Prevent IE 6 from affecting layout for positioned elements #11048 + // Prevent IE from shrinking the body in IE 7 mode #12869 + // Support: IE<8 + body.style.zoom = 1; + } + } + + body.removeChild( container ); +} ); + + +( function() { + var div = document.createElement( "div" ); + + // Support: IE<9 + support.deleteExpando = true; + try { + delete div.test; + } catch ( e ) { + support.deleteExpando = false; + } + + // Null elements to avoid leaks in IE. + div = null; +} )(); +var acceptData = function( elem ) { + var noData = jQuery.noData[ ( elem.nodeName + " " ).toLowerCase() ], + nodeType = +elem.nodeType || 1; + + // Do not set data on non-element DOM nodes because it will not be cleared (#8335). + return nodeType !== 1 && nodeType !== 9 ? + false : + + // Nodes accept data unless otherwise specified; rejection can be conditional + !noData || noData !== true && elem.getAttribute( "classid" ) === noData; +}; + + + + +var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, + rmultiDash = /([A-Z])/g; + +function dataAttr( elem, key, data ) { + + // If nothing was found internally, try to fetch any + // data from the HTML5 data-* attribute + if ( data === undefined && elem.nodeType === 1 ) { + + var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase(); + + data = elem.getAttribute( name ); + + if ( typeof data === "string" ) { + try { + data = data === "true" ? true : + data === "false" ? false : + data === "null" ? null : + + // Only convert to a number if it doesn't change the string + +data + "" === data ? +data : + rbrace.test( data ) ? jQuery.parseJSON( data ) : + data; + } catch ( e ) {} + + // Make sure we set the data so it isn't changed later + jQuery.data( elem, key, data ); + + } else { + data = undefined; + } + } + + return data; +} + +// checks a cache object for emptiness +function isEmptyDataObject( obj ) { + var name; + for ( name in obj ) { + + // if the public data object is empty, the private is still empty + if ( name === "data" && jQuery.isEmptyObject( obj[ name ] ) ) { + continue; + } + if ( name !== "toJSON" ) { + return false; + } + } + + return true; +} + +function internalData( elem, name, data, pvt /* Internal Use Only */ ) { + if ( !acceptData( elem ) ) { + return; + } + + var ret, thisCache, + internalKey = jQuery.expando, + + // We have to handle DOM nodes and JS objects differently because IE6-7 + // can't GC object references properly across the DOM-JS boundary + isNode = elem.nodeType, + + // Only DOM nodes need the global jQuery cache; JS object data is + // attached directly to the object so GC can occur automatically + cache = isNode ? jQuery.cache : elem, + + // Only defining an ID for JS objects if its cache already exists allows + // the code to shortcut on the same path as a DOM node with no cache + id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey; + + // Avoid doing any more work than we need to when trying to get data on an + // object that has no data at all + if ( ( !id || !cache[ id ] || ( !pvt && !cache[ id ].data ) ) && + data === undefined && typeof name === "string" ) { + return; + } + + if ( !id ) { + + // Only DOM nodes need a new unique ID for each element since their data + // ends up in the global cache + if ( isNode ) { + id = elem[ internalKey ] = deletedIds.pop() || jQuery.guid++; + } else { + id = internalKey; + } + } + + if ( !cache[ id ] ) { + + // Avoid exposing jQuery metadata on plain JS objects when the object + // is serialized using JSON.stringify + cache[ id ] = isNode ? {} : { toJSON: jQuery.noop }; + } + + // An object can be passed to jQuery.data instead of a key/value pair; this gets + // shallow copied over onto the existing cache + if ( typeof name === "object" || typeof name === "function" ) { + if ( pvt ) { + cache[ id ] = jQuery.extend( cache[ id ], name ); + } else { + cache[ id ].data = jQuery.extend( cache[ id ].data, name ); + } + } + + thisCache = cache[ id ]; + + // jQuery data() is stored in a separate object inside the object's internal data + // cache in order to avoid key collisions between internal data and user-defined + // data. + if ( !pvt ) { + if ( !thisCache.data ) { + thisCache.data = {}; + } + + thisCache = thisCache.data; + } + + if ( data !== undefined ) { + thisCache[ jQuery.camelCase( name ) ] = data; + } + + // Check for both converted-to-camel and non-converted data property names + // If a data property was specified + if ( typeof name === "string" ) { + + // First Try to find as-is property data + ret = thisCache[ name ]; + + // Test for null|undefined property data + if ( ret == null ) { + + // Try to find the camelCased property + ret = thisCache[ jQuery.camelCase( name ) ]; + } + } else { + ret = thisCache; + } + + return ret; +} + +function internalRemoveData( elem, name, pvt ) { + if ( !acceptData( elem ) ) { + return; + } + + var thisCache, i, + isNode = elem.nodeType, + + // See jQuery.data for more information + cache = isNode ? jQuery.cache : elem, + id = isNode ? elem[ jQuery.expando ] : jQuery.expando; + + // If there is already no cache entry for this object, there is no + // purpose in continuing + if ( !cache[ id ] ) { + return; + } + + if ( name ) { + + thisCache = pvt ? cache[ id ] : cache[ id ].data; + + if ( thisCache ) { + + // Support array or space separated string names for data keys + if ( !jQuery.isArray( name ) ) { + + // try the string as a key before any manipulation + if ( name in thisCache ) { + name = [ name ]; + } else { + + // split the camel cased version by spaces unless a key with the spaces exists + name = jQuery.camelCase( name ); + if ( name in thisCache ) { + name = [ name ]; + } else { + name = name.split( " " ); + } + } + } else { + + // If "name" is an array of keys... + // When data is initially created, via ("key", "val") signature, + // keys will be converted to camelCase. + // Since there is no way to tell _how_ a key was added, remove + // both plain key and camelCase key. #12786 + // This will only penalize the array argument path. + name = name.concat( jQuery.map( name, jQuery.camelCase ) ); + } + + i = name.length; + while ( i-- ) { + delete thisCache[ name[ i ] ]; + } + + // If there is no data left in the cache, we want to continue + // and let the cache object itself get destroyed + if ( pvt ? !isEmptyDataObject( thisCache ) : !jQuery.isEmptyObject( thisCache ) ) { + return; + } + } + } + + // See jQuery.data for more information + if ( !pvt ) { + delete cache[ id ].data; + + // Don't destroy the parent cache unless the internal data object + // had been the only thing left in it + if ( !isEmptyDataObject( cache[ id ] ) ) { + return; + } + } + + // Destroy the cache + if ( isNode ) { + jQuery.cleanData( [ elem ], true ); + + // Use delete when supported for expandos or `cache` is not a window per isWindow (#10080) + /* jshint eqeqeq: false */ + } else if ( support.deleteExpando || cache != cache.window ) { + /* jshint eqeqeq: true */ + delete cache[ id ]; + + // When all else fails, undefined + } else { + cache[ id ] = undefined; + } +} + +jQuery.extend( { + cache: {}, + + // The following elements (space-suffixed to avoid Object.prototype collisions) + // throw uncatchable exceptions if you attempt to set expando properties + noData: { + "applet ": true, + "embed ": true, + + // ...but Flash objects (which have this classid) *can* handle expandos + "object ": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" + }, + + hasData: function( elem ) { + elem = elem.nodeType ? jQuery.cache[ elem[ jQuery.expando ] ] : elem[ jQuery.expando ]; + return !!elem && !isEmptyDataObject( elem ); + }, + + data: function( elem, name, data ) { + return internalData( elem, name, data ); + }, + + removeData: function( elem, name ) { + return internalRemoveData( elem, name ); + }, + + // For internal use only. + _data: function( elem, name, data ) { + return internalData( elem, name, data, true ); + }, + + _removeData: function( elem, name ) { + return internalRemoveData( elem, name, true ); + } +} ); + +jQuery.fn.extend( { + data: function( key, value ) { + var i, name, data, + elem = this[ 0 ], + attrs = elem && elem.attributes; + + // Special expections of .data basically thwart jQuery.access, + // so implement the relevant behavior ourselves + + // Gets all values + if ( key === undefined ) { + if ( this.length ) { + data = jQuery.data( elem ); + + if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) { + i = attrs.length; + while ( i-- ) { + + // Support: IE11+ + // The attrs elements can be null (#14894) + if ( attrs[ i ] ) { + name = attrs[ i ].name; + if ( name.indexOf( "data-" ) === 0 ) { + name = jQuery.camelCase( name.slice( 5 ) ); + dataAttr( elem, name, data[ name ] ); + } + } + } + jQuery._data( elem, "parsedAttrs", true ); + } + } + + return data; + } + + // Sets multiple values + if ( typeof key === "object" ) { + return this.each( function() { + jQuery.data( this, key ); + } ); + } + + return arguments.length > 1 ? + + // Sets one value + this.each( function() { + jQuery.data( this, key, value ); + } ) : + + // Gets one value + // Try to fetch any internally stored data first + elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : undefined; + }, + + removeData: function( key ) { + return this.each( function() { + jQuery.removeData( this, key ); + } ); + } +} ); + + +jQuery.extend( { + queue: function( elem, type, data ) { + var queue; + + if ( elem ) { + type = ( type || "fx" ) + "queue"; + queue = jQuery._data( elem, type ); + + // Speed up dequeue by getting out quickly if this is just a lookup + if ( data ) { + if ( !queue || jQuery.isArray( data ) ) { + queue = jQuery._data( elem, type, jQuery.makeArray( data ) ); + } else { + queue.push( data ); + } + } + return queue || []; + } + }, + + dequeue: function( elem, type ) { + type = type || "fx"; + + var queue = jQuery.queue( elem, type ), + startLength = queue.length, + fn = queue.shift(), + hooks = jQuery._queueHooks( elem, type ), + next = function() { + jQuery.dequeue( elem, type ); + }; + + // If the fx queue is dequeued, always remove the progress sentinel + if ( fn === "inprogress" ) { + fn = queue.shift(); + startLength--; + } + + if ( fn ) { + + // Add a progress sentinel to prevent the fx queue from being + // automatically dequeued + if ( type === "fx" ) { + queue.unshift( "inprogress" ); + } + + // clear up the last queue stop function + delete hooks.stop; + fn.call( elem, next, hooks ); + } + + if ( !startLength && hooks ) { + hooks.empty.fire(); + } + }, + + // not intended for public consumption - generates a queueHooks object, + // or returns the current one + _queueHooks: function( elem, type ) { + var key = type + "queueHooks"; + return jQuery._data( elem, key ) || jQuery._data( elem, key, { + empty: jQuery.Callbacks( "once memory" ).add( function() { + jQuery._removeData( elem, type + "queue" ); + jQuery._removeData( elem, key ); + } ) + } ); + } +} ); + +jQuery.fn.extend( { + queue: function( type, data ) { + var setter = 2; + + if ( typeof type !== "string" ) { + data = type; + type = "fx"; + setter--; + } + + if ( arguments.length < setter ) { + return jQuery.queue( this[ 0 ], type ); + } + + return data === undefined ? + this : + this.each( function() { + var queue = jQuery.queue( this, type, data ); + + // ensure a hooks for this queue + jQuery._queueHooks( this, type ); + + if ( type === "fx" && queue[ 0 ] !== "inprogress" ) { + jQuery.dequeue( this, type ); + } + } ); + }, + dequeue: function( type ) { + return this.each( function() { + jQuery.dequeue( this, type ); + } ); + }, + clearQueue: function( type ) { + return this.queue( type || "fx", [] ); + }, + + // Get a promise resolved when queues of a certain type + // are emptied (fx is the type by default) + promise: function( type, obj ) { + var tmp, + count = 1, + defer = jQuery.Deferred(), + elements = this, + i = this.length, + resolve = function() { + if ( !( --count ) ) { + defer.resolveWith( elements, [ elements ] ); + } + }; + + if ( typeof type !== "string" ) { + obj = type; + type = undefined; + } + type = type || "fx"; + + while ( i-- ) { + tmp = jQuery._data( elements[ i ], type + "queueHooks" ); + if ( tmp && tmp.empty ) { + count++; + tmp.empty.add( resolve ); + } + } + resolve(); + return defer.promise( obj ); + } +} ); + + +( function() { + var shrinkWrapBlocksVal; + + support.shrinkWrapBlocks = function() { + if ( shrinkWrapBlocksVal != null ) { + return shrinkWrapBlocksVal; + } + + // Will be changed later if needed. + shrinkWrapBlocksVal = false; + + // Minified: var b,c,d + var div, body, container; + + body = document.getElementsByTagName( "body" )[ 0 ]; + if ( !body || !body.style ) { + + // Test fired too early or in an unsupported environment, exit. + return; + } + + // Setup + div = document.createElement( "div" ); + container = document.createElement( "div" ); + container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px"; + body.appendChild( container ).appendChild( div ); + + // Support: IE6 + // Check if elements with layout shrink-wrap their children + if ( typeof div.style.zoom !== "undefined" ) { + + // Reset CSS: box-sizing; display; margin; border + div.style.cssText = + + // Support: Firefox<29, Android 2.3 + // Vendor-prefix box-sizing + "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" + + "box-sizing:content-box;display:block;margin:0;border:0;" + + "padding:1px;width:1px;zoom:1"; + div.appendChild( document.createElement( "div" ) ).style.width = "5px"; + shrinkWrapBlocksVal = div.offsetWidth !== 3; + } + + body.removeChild( container ); + + return shrinkWrapBlocksVal; + }; + +} )(); +var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source; + +var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ); + + +var cssExpand = [ "Top", "Right", "Bottom", "Left" ]; + +var isHidden = function( elem, el ) { + + // isHidden might be called from jQuery#filter function; + // in that case, element will be second argument + elem = el || elem; + return jQuery.css( elem, "display" ) === "none" || + !jQuery.contains( elem.ownerDocument, elem ); + }; + + + +function adjustCSS( elem, prop, valueParts, tween ) { + var adjusted, + scale = 1, + maxIterations = 20, + currentValue = tween ? + function() { return tween.cur(); } : + function() { return jQuery.css( elem, prop, "" ); }, + initial = currentValue(), + unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ), + + // Starting value computation is required for potential unit mismatches + initialInUnit = ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) && + rcssNum.exec( jQuery.css( elem, prop ) ); + + if ( initialInUnit && initialInUnit[ 3 ] !== unit ) { + + // Trust units reported by jQuery.css + unit = unit || initialInUnit[ 3 ]; + + // Make sure we update the tween properties later on + valueParts = valueParts || []; + + // Iteratively approximate from a nonzero starting point + initialInUnit = +initial || 1; + + do { + + // If previous iteration zeroed out, double until we get *something*. + // Use string for doubling so we don't accidentally see scale as unchanged below + scale = scale || ".5"; + + // Adjust and apply + initialInUnit = initialInUnit / scale; + jQuery.style( elem, prop, initialInUnit + unit ); + + // Update scale, tolerating zero or NaN from tween.cur() + // Break the loop if scale is unchanged or perfect, or if we've just had enough. + } while ( + scale !== ( scale = currentValue() / initial ) && scale !== 1 && --maxIterations + ); + } + + if ( valueParts ) { + initialInUnit = +initialInUnit || +initial || 0; + + // Apply relative offset (+=/-=) if specified + adjusted = valueParts[ 1 ] ? + initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] : + +valueParts[ 2 ]; + if ( tween ) { + tween.unit = unit; + tween.start = initialInUnit; + tween.end = adjusted; + } + } + return adjusted; +} + + +// Multifunctional method to get and set values of a collection +// The value/s can optionally be executed if it's a function +var access = function( elems, fn, key, value, chainable, emptyGet, raw ) { + var i = 0, + length = elems.length, + bulk = key == null; + + // Sets many values + if ( jQuery.type( key ) === "object" ) { + chainable = true; + for ( i in key ) { + access( elems, fn, i, key[ i ], true, emptyGet, raw ); + } + + // Sets one value + } else if ( value !== undefined ) { + chainable = true; + + if ( !jQuery.isFunction( value ) ) { + raw = true; + } + + if ( bulk ) { + + // Bulk operations run against the entire set + if ( raw ) { + fn.call( elems, value ); + fn = null; + + // ...except when executing function values + } else { + bulk = fn; + fn = function( elem, key, value ) { + return bulk.call( jQuery( elem ), value ); + }; + } + } + + if ( fn ) { + for ( ; i < length; i++ ) { + fn( + elems[ i ], + key, + raw ? value : value.call( elems[ i ], i, fn( elems[ i ], key ) ) + ); + } + } + } + + return chainable ? + elems : + + // Gets + bulk ? + fn.call( elems ) : + length ? fn( elems[ 0 ], key ) : emptyGet; +}; +var rcheckableType = ( /^(?:checkbox|radio)$/i ); + +var rtagName = ( /<([\w:-]+)/ ); + +var rscriptType = ( /^$|\/(?:java|ecma)script/i ); + +var rleadingWhitespace = ( /^\s+/ ); + +var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|" + + "details|dialog|figcaption|figure|footer|header|hgroup|main|" + + "mark|meter|nav|output|picture|progress|section|summary|template|time|video"; + + + +function createSafeFragment( document ) { + var list = nodeNames.split( "|" ), + safeFrag = document.createDocumentFragment(); + + if ( safeFrag.createElement ) { + while ( list.length ) { + safeFrag.createElement( + list.pop() + ); + } + } + return safeFrag; +} + + +( function() { + var div = document.createElement( "div" ), + fragment = document.createDocumentFragment(), + input = document.createElement( "input" ); + + // Setup + div.innerHTML = "
a"; + + // IE strips leading whitespace when .innerHTML is used + support.leadingWhitespace = div.firstChild.nodeType === 3; + + // Make sure that tbody elements aren't automatically inserted + // IE will insert them into empty tables + support.tbody = !div.getElementsByTagName( "tbody" ).length; + + // Make sure that link elements get serialized correctly by innerHTML + // This requires a wrapper element in IE + support.htmlSerialize = !!div.getElementsByTagName( "link" ).length; + + // Makes sure cloning an html5 element does not cause problems + // Where outerHTML is undefined, this still works + support.html5Clone = + document.createElement( "nav" ).cloneNode( true ).outerHTML !== "<:nav>"; + + // Check if a disconnected checkbox will retain its checked + // value of true after appended to the DOM (IE6/7) + input.type = "checkbox"; + input.checked = true; + fragment.appendChild( input ); + support.appendChecked = input.checked; + + // Make sure textarea (and checkbox) defaultValue is properly cloned + // Support: IE6-IE11+ + div.innerHTML = ""; + support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; + + // #11217 - WebKit loses check when the name is after the checked attribute + fragment.appendChild( div ); + + // Support: Windows Web Apps (WWA) + // `name` and `type` must use .setAttribute for WWA (#14901) + input = document.createElement( "input" ); + input.setAttribute( "type", "radio" ); + input.setAttribute( "checked", "checked" ); + input.setAttribute( "name", "t" ); + + div.appendChild( input ); + + // Support: Safari 5.1, iOS 5.1, Android 4.x, Android 2.3 + // old WebKit doesn't clone checked state correctly in fragments + support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked; + + // Support: IE<9 + // Cloned elements keep attachEvent handlers, we use addEventListener on IE9+ + support.noCloneEvent = !!div.addEventListener; + + // Support: IE<9 + // Since attributes and properties are the same in IE, + // cleanData must set properties to undefined rather than use removeAttribute + div[ jQuery.expando ] = 1; + support.attributes = !div.getAttribute( jQuery.expando ); +} )(); + + +// We have to close these tags to support XHTML (#13200) +var wrapMap = { + option: [ 1, "" ], + legend: [ 1, "
", "
" ], + area: [ 1, "", "" ], + + // Support: IE8 + param: [ 1, "", "" ], + thead: [ 1, "", "
" ], + tr: [ 2, "", "
" ], + col: [ 2, "", "
" ], + td: [ 3, "", "
" ], + + // IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags, + // unless wrapped in a div with non-breaking characters in front of it. + _default: support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X
", "
" ] +}; + +// Support: IE8-IE9 +wrapMap.optgroup = wrapMap.option; + +wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; +wrapMap.th = wrapMap.td; + + +function getAll( context, tag ) { + var elems, elem, + i = 0, + found = typeof context.getElementsByTagName !== "undefined" ? + context.getElementsByTagName( tag || "*" ) : + typeof context.querySelectorAll !== "undefined" ? + context.querySelectorAll( tag || "*" ) : + undefined; + + if ( !found ) { + for ( found = [], elems = context.childNodes || context; + ( elem = elems[ i ] ) != null; + i++ + ) { + if ( !tag || jQuery.nodeName( elem, tag ) ) { + found.push( elem ); + } else { + jQuery.merge( found, getAll( elem, tag ) ); + } + } + } + + return tag === undefined || tag && jQuery.nodeName( context, tag ) ? + jQuery.merge( [ context ], found ) : + found; +} + + +// Mark scripts as having already been evaluated +function setGlobalEval( elems, refElements ) { + var elem, + i = 0; + for ( ; ( elem = elems[ i ] ) != null; i++ ) { + jQuery._data( + elem, + "globalEval", + !refElements || jQuery._data( refElements[ i ], "globalEval" ) + ); + } +} + + +var rhtml = /<|&#?\w+;/, + rtbody = / from table fragments + if ( !support.tbody ) { + + // String was a , *may* have spurious + elem = tag === "table" && !rtbody.test( elem ) ? + tmp.firstChild : + + // String was a bare or + wrap[ 1 ] === "
" && !rtbody.test( elem ) ? + tmp : + 0; + + j = elem && elem.childNodes.length; + while ( j-- ) { + if ( jQuery.nodeName( ( tbody = elem.childNodes[ j ] ), "tbody" ) && + !tbody.childNodes.length ) { + + elem.removeChild( tbody ); + } + } + } + + jQuery.merge( nodes, tmp.childNodes ); + + // Fix #12392 for WebKit and IE > 9 + tmp.textContent = ""; + + // Fix #12392 for oldIE + while ( tmp.firstChild ) { + tmp.removeChild( tmp.firstChild ); + } + + // Remember the top-level container for proper cleanup + tmp = safe.lastChild; + } + } + } + + // Fix #11356: Clear elements from fragment + if ( tmp ) { + safe.removeChild( tmp ); + } + + // Reset defaultChecked for any radios and checkboxes + // about to be appended to the DOM in IE 6/7 (#8060) + if ( !support.appendChecked ) { + jQuery.grep( getAll( nodes, "input" ), fixDefaultChecked ); + } + + i = 0; + while ( ( elem = nodes[ i++ ] ) ) { + + // Skip elements already in the context collection (trac-4087) + if ( selection && jQuery.inArray( elem, selection ) > -1 ) { + if ( ignored ) { + ignored.push( elem ); + } + + continue; + } + + contains = jQuery.contains( elem.ownerDocument, elem ); + + // Append to fragment + tmp = getAll( safe.appendChild( elem ), "script" ); + + // Preserve script evaluation history + if ( contains ) { + setGlobalEval( tmp ); + } + + // Capture executables + if ( scripts ) { + j = 0; + while ( ( elem = tmp[ j++ ] ) ) { + if ( rscriptType.test( elem.type || "" ) ) { + scripts.push( elem ); + } + } + } + } + + tmp = null; + + return safe; +} + + +( function() { + var i, eventName, + div = document.createElement( "div" ); + + // Support: IE<9 (lack submit/change bubble), Firefox (lack focus(in | out) events) + for ( i in { submit: true, change: true, focusin: true } ) { + eventName = "on" + i; + + if ( !( support[ i ] = eventName in window ) ) { + + // Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP) + div.setAttribute( eventName, "t" ); + support[ i ] = div.attributes[ eventName ].expando === false; + } + } + + // Null elements to avoid leaks in IE. + div = null; +} )(); + + +var rformElems = /^(?:input|select|textarea)$/i, + rkeyEvent = /^key/, + rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/, + rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, + rtypenamespace = /^([^.]*)(?:\.(.+)|)/; + +function returnTrue() { + return true; +} + +function returnFalse() { + return false; +} + +// Support: IE9 +// See #13393 for more info +function safeActiveElement() { + try { + return document.activeElement; + } catch ( err ) { } +} + +function on( elem, types, selector, data, fn, one ) { + var origFn, type; + + // Types can be a map of types/handlers + if ( typeof types === "object" ) { + + // ( types-Object, selector, data ) + if ( typeof selector !== "string" ) { + + // ( types-Object, data ) + data = data || selector; + selector = undefined; + } + for ( type in types ) { + on( elem, type, selector, data, types[ type ], one ); + } + return elem; + } + + if ( data == null && fn == null ) { + + // ( types, fn ) + fn = selector; + data = selector = undefined; + } else if ( fn == null ) { + if ( typeof selector === "string" ) { + + // ( types, selector, fn ) + fn = data; + data = undefined; + } else { + + // ( types, data, fn ) + fn = data; + data = selector; + selector = undefined; + } + } + if ( fn === false ) { + fn = returnFalse; + } else if ( !fn ) { + return elem; + } + + if ( one === 1 ) { + origFn = fn; + fn = function( event ) { + + // Can use an empty set, since event contains the info + jQuery().off( event ); + return origFn.apply( this, arguments ); + }; + + // Use same guid so caller can remove using origFn + fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); + } + return elem.each( function() { + jQuery.event.add( this, types, fn, data, selector ); + } ); +} + +/* + * Helper functions for managing events -- not part of the public interface. + * Props to Dean Edwards' addEvent library for many of the ideas. + */ +jQuery.event = { + + global: {}, + + add: function( elem, types, handler, data, selector ) { + var tmp, events, t, handleObjIn, + special, eventHandle, handleObj, + handlers, type, namespaces, origType, + elemData = jQuery._data( elem ); + + // Don't attach events to noData or text/comment nodes (but allow plain objects) + if ( !elemData ) { + return; + } + + // Caller can pass in an object of custom data in lieu of the handler + if ( handler.handler ) { + handleObjIn = handler; + handler = handleObjIn.handler; + selector = handleObjIn.selector; + } + + // Make sure that the handler has a unique ID, used to find/remove it later + if ( !handler.guid ) { + handler.guid = jQuery.guid++; + } + + // Init the element's event structure and main handler, if this is the first + if ( !( events = elemData.events ) ) { + events = elemData.events = {}; + } + if ( !( eventHandle = elemData.handle ) ) { + eventHandle = elemData.handle = function( e ) { + + // Discard the second event of a jQuery.event.trigger() and + // when an event is called after a page has unloaded + return typeof jQuery !== "undefined" && + ( !e || jQuery.event.triggered !== e.type ) ? + jQuery.event.dispatch.apply( eventHandle.elem, arguments ) : + undefined; + }; + + // Add elem as a property of the handle fn to prevent a memory leak + // with IE non-native events + eventHandle.elem = elem; + } + + // Handle multiple events separated by a space + types = ( types || "" ).match( rnotwhite ) || [ "" ]; + t = types.length; + while ( t-- ) { + tmp = rtypenamespace.exec( types[ t ] ) || []; + type = origType = tmp[ 1 ]; + namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); + + // There *must* be a type, no attaching namespace-only handlers + if ( !type ) { + continue; + } + + // If event changes its type, use the special event handlers for the changed type + special = jQuery.event.special[ type ] || {}; + + // If selector defined, determine special event api type, otherwise given type + type = ( selector ? special.delegateType : special.bindType ) || type; + + // Update special based on newly reset type + special = jQuery.event.special[ type ] || {}; + + // handleObj is passed to all event handlers + handleObj = jQuery.extend( { + type: type, + origType: origType, + data: data, + handler: handler, + guid: handler.guid, + selector: selector, + needsContext: selector && jQuery.expr.match.needsContext.test( selector ), + namespace: namespaces.join( "." ) + }, handleObjIn ); + + // Init the event handler queue if we're the first + if ( !( handlers = events[ type ] ) ) { + handlers = events[ type ] = []; + handlers.delegateCount = 0; + + // Only use addEventListener/attachEvent if the special events handler returns false + if ( !special.setup || + special.setup.call( elem, data, namespaces, eventHandle ) === false ) { + + // Bind the global event handler to the element + if ( elem.addEventListener ) { + elem.addEventListener( type, eventHandle, false ); + + } else if ( elem.attachEvent ) { + elem.attachEvent( "on" + type, eventHandle ); + } + } + } + + if ( special.add ) { + special.add.call( elem, handleObj ); + + if ( !handleObj.handler.guid ) { + handleObj.handler.guid = handler.guid; + } + } + + // Add to the element's handler list, delegates in front + if ( selector ) { + handlers.splice( handlers.delegateCount++, 0, handleObj ); + } else { + handlers.push( handleObj ); + } + + // Keep track of which events have ever been used, for event optimization + jQuery.event.global[ type ] = true; + } + + // Nullify elem to prevent memory leaks in IE + elem = null; + }, + + // Detach an event or set of events from an element + remove: function( elem, types, handler, selector, mappedTypes ) { + var j, handleObj, tmp, + origCount, t, events, + special, handlers, type, + namespaces, origType, + elemData = jQuery.hasData( elem ) && jQuery._data( elem ); + + if ( !elemData || !( events = elemData.events ) ) { + return; + } + + // Once for each type.namespace in types; type may be omitted + types = ( types || "" ).match( rnotwhite ) || [ "" ]; + t = types.length; + while ( t-- ) { + tmp = rtypenamespace.exec( types[ t ] ) || []; + type = origType = tmp[ 1 ]; + namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); + + // Unbind all events (on this namespace, if provided) for the element + if ( !type ) { + for ( type in events ) { + jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); + } + continue; + } + + special = jQuery.event.special[ type ] || {}; + type = ( selector ? special.delegateType : special.bindType ) || type; + handlers = events[ type ] || []; + tmp = tmp[ 2 ] && + new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ); + + // Remove matching events + origCount = j = handlers.length; + while ( j-- ) { + handleObj = handlers[ j ]; + + if ( ( mappedTypes || origType === handleObj.origType ) && + ( !handler || handler.guid === handleObj.guid ) && + ( !tmp || tmp.test( handleObj.namespace ) ) && + ( !selector || selector === handleObj.selector || + selector === "**" && handleObj.selector ) ) { + handlers.splice( j, 1 ); + + if ( handleObj.selector ) { + handlers.delegateCount--; + } + if ( special.remove ) { + special.remove.call( elem, handleObj ); + } + } + } + + // Remove generic event handler if we removed something and no more handlers exist + // (avoids potential for endless recursion during removal of special event handlers) + if ( origCount && !handlers.length ) { + if ( !special.teardown || + special.teardown.call( elem, namespaces, elemData.handle ) === false ) { + + jQuery.removeEvent( elem, type, elemData.handle ); + } + + delete events[ type ]; + } + } + + // Remove the expando if it's no longer used + if ( jQuery.isEmptyObject( events ) ) { + delete elemData.handle; + + // removeData also checks for emptiness and clears the expando if empty + // so use it instead of delete + jQuery._removeData( elem, "events" ); + } + }, + + trigger: function( event, data, elem, onlyHandlers ) { + var handle, ontype, cur, + bubbleType, special, tmp, i, + eventPath = [ elem || document ], + type = hasOwn.call( event, "type" ) ? event.type : event, + namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : []; + + cur = tmp = elem = elem || document; + + // Don't do events on text and comment nodes + if ( elem.nodeType === 3 || elem.nodeType === 8 ) { + return; + } + + // focus/blur morphs to focusin/out; ensure we're not firing them right now + if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { + return; + } + + if ( type.indexOf( "." ) > -1 ) { + + // Namespaced trigger; create a regexp to match event type in handle() + namespaces = type.split( "." ); + type = namespaces.shift(); + namespaces.sort(); + } + ontype = type.indexOf( ":" ) < 0 && "on" + type; + + // Caller can pass in a jQuery.Event object, Object, or just an event type string + event = event[ jQuery.expando ] ? + event : + new jQuery.Event( type, typeof event === "object" && event ); + + // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) + event.isTrigger = onlyHandlers ? 2 : 3; + event.namespace = namespaces.join( "." ); + event.rnamespace = event.namespace ? + new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) : + null; + + // Clean up the event in case it is being reused + event.result = undefined; + if ( !event.target ) { + event.target = elem; + } + + // Clone any incoming data and prepend the event, creating the handler arg list + data = data == null ? + [ event ] : + jQuery.makeArray( data, [ event ] ); + + // Allow special events to draw outside the lines + special = jQuery.event.special[ type ] || {}; + if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { + return; + } + + // Determine event propagation path in advance, per W3C events spec (#9951) + // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) + if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) { + + bubbleType = special.delegateType || type; + if ( !rfocusMorph.test( bubbleType + type ) ) { + cur = cur.parentNode; + } + for ( ; cur; cur = cur.parentNode ) { + eventPath.push( cur ); + tmp = cur; + } + + // Only add window if we got to document (e.g., not plain obj or detached DOM) + if ( tmp === ( elem.ownerDocument || document ) ) { + eventPath.push( tmp.defaultView || tmp.parentWindow || window ); + } + } + + // Fire handlers on the event path + i = 0; + while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) { + + event.type = i > 1 ? + bubbleType : + special.bindType || type; + + // jQuery handler + handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && + jQuery._data( cur, "handle" ); + + if ( handle ) { + handle.apply( cur, data ); + } + + // Native handler + handle = ontype && cur[ ontype ]; + if ( handle && handle.apply && acceptData( cur ) ) { + event.result = handle.apply( cur, data ); + if ( event.result === false ) { + event.preventDefault(); + } + } + } + event.type = type; + + // If nobody prevented the default action, do it now + if ( !onlyHandlers && !event.isDefaultPrevented() ) { + + if ( + ( !special._default || + special._default.apply( eventPath.pop(), data ) === false + ) && acceptData( elem ) + ) { + + // Call a native DOM method on the target with the same name name as the event. + // Can't use an .isFunction() check here because IE6/7 fails that test. + // Don't do default actions on window, that's where global variables be (#6170) + if ( ontype && elem[ type ] && !jQuery.isWindow( elem ) ) { + + // Don't re-trigger an onFOO event when we call its FOO() method + tmp = elem[ ontype ]; + + if ( tmp ) { + elem[ ontype ] = null; + } + + // Prevent re-triggering of the same event, since we already bubbled it above + jQuery.event.triggered = type; + try { + elem[ type ](); + } catch ( e ) { + + // IE<9 dies on focus/blur to hidden element (#1486,#12518) + // only reproducible on winXP IE8 native, not IE9 in IE8 mode + } + jQuery.event.triggered = undefined; + + if ( tmp ) { + elem[ ontype ] = tmp; + } + } + } + } + + return event.result; + }, + + dispatch: function( event ) { + + // Make a writable jQuery.Event from the native event object + event = jQuery.event.fix( event ); + + var i, j, ret, matched, handleObj, + handlerQueue = [], + args = slice.call( arguments ), + handlers = ( jQuery._data( this, "events" ) || {} )[ event.type ] || [], + special = jQuery.event.special[ event.type ] || {}; + + // Use the fix-ed jQuery.Event rather than the (read-only) native event + args[ 0 ] = event; + event.delegateTarget = this; + + // Call the preDispatch hook for the mapped type, and let it bail if desired + if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { + return; + } + + // Determine handlers + handlerQueue = jQuery.event.handlers.call( this, event, handlers ); + + // Run delegates first; they may want to stop propagation beneath us + i = 0; + while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) { + event.currentTarget = matched.elem; + + j = 0; + while ( ( handleObj = matched.handlers[ j++ ] ) && + !event.isImmediatePropagationStopped() ) { + + // Triggered event must either 1) have no namespace, or 2) have namespace(s) + // a subset or equal to those in the bound event (both can have no namespace). + if ( !event.rnamespace || event.rnamespace.test( handleObj.namespace ) ) { + + event.handleObj = handleObj; + event.data = handleObj.data; + + ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle || + handleObj.handler ).apply( matched.elem, args ); + + if ( ret !== undefined ) { + if ( ( event.result = ret ) === false ) { + event.preventDefault(); + event.stopPropagation(); + } + } + } + } + } + + // Call the postDispatch hook for the mapped type + if ( special.postDispatch ) { + special.postDispatch.call( this, event ); + } + + return event.result; + }, + + handlers: function( event, handlers ) { + var i, matches, sel, handleObj, + handlerQueue = [], + delegateCount = handlers.delegateCount, + cur = event.target; + + // Support (at least): Chrome, IE9 + // Find delegate handlers + // Black-hole SVG instance trees (#13180) + // + // Support: Firefox<=42+ + // Avoid non-left-click in FF but don't block IE radio events (#3861, gh-2343) + if ( delegateCount && cur.nodeType && + ( event.type !== "click" || isNaN( event.button ) || event.button < 1 ) ) { + + /* jshint eqeqeq: false */ + for ( ; cur != this; cur = cur.parentNode || this ) { + /* jshint eqeqeq: true */ + + // Don't check non-elements (#13208) + // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) + if ( cur.nodeType === 1 && ( cur.disabled !== true || event.type !== "click" ) ) { + matches = []; + for ( i = 0; i < delegateCount; i++ ) { + handleObj = handlers[ i ]; + + // Don't conflict with Object.prototype properties (#13203) + sel = handleObj.selector + " "; + + if ( matches[ sel ] === undefined ) { + matches[ sel ] = handleObj.needsContext ? + jQuery( sel, this ).index( cur ) > -1 : + jQuery.find( sel, this, null, [ cur ] ).length; + } + if ( matches[ sel ] ) { + matches.push( handleObj ); + } + } + if ( matches.length ) { + handlerQueue.push( { elem: cur, handlers: matches } ); + } + } + } + } + + // Add the remaining (directly-bound) handlers + if ( delegateCount < handlers.length ) { + handlerQueue.push( { elem: this, handlers: handlers.slice( delegateCount ) } ); + } + + return handlerQueue; + }, + + fix: function( event ) { + if ( event[ jQuery.expando ] ) { + return event; + } + + // Create a writable copy of the event object and normalize some properties + var i, prop, copy, + type = event.type, + originalEvent = event, + fixHook = this.fixHooks[ type ]; + + if ( !fixHook ) { + this.fixHooks[ type ] = fixHook = + rmouseEvent.test( type ) ? this.mouseHooks : + rkeyEvent.test( type ) ? this.keyHooks : + {}; + } + copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props; + + event = new jQuery.Event( originalEvent ); + + i = copy.length; + while ( i-- ) { + prop = copy[ i ]; + event[ prop ] = originalEvent[ prop ]; + } + + // Support: IE<9 + // Fix target property (#1925) + if ( !event.target ) { + event.target = originalEvent.srcElement || document; + } + + // Support: Safari 6-8+ + // Target should not be a text node (#504, #13143) + if ( event.target.nodeType === 3 ) { + event.target = event.target.parentNode; + } + + // Support: IE<9 + // For mouse/key events, metaKey==false if it's undefined (#3368, #11328) + event.metaKey = !!event.metaKey; + + return fixHook.filter ? fixHook.filter( event, originalEvent ) : event; + }, + + // Includes some event props shared by KeyEvent and MouseEvent + props: ( "altKey bubbles cancelable ctrlKey currentTarget detail eventPhase " + + "metaKey relatedTarget shiftKey target timeStamp view which" ).split( " " ), + + fixHooks: {}, + + keyHooks: { + props: "char charCode key keyCode".split( " " ), + filter: function( event, original ) { + + // Add which for key events + if ( event.which == null ) { + event.which = original.charCode != null ? original.charCode : original.keyCode; + } + + return event; + } + }, + + mouseHooks: { + props: ( "button buttons clientX clientY fromElement offsetX offsetY " + + "pageX pageY screenX screenY toElement" ).split( " " ), + filter: function( event, original ) { + var body, eventDoc, doc, + button = original.button, + fromElement = original.fromElement; + + // Calculate pageX/Y if missing and clientX/Y available + if ( event.pageX == null && original.clientX != null ) { + eventDoc = event.target.ownerDocument || document; + doc = eventDoc.documentElement; + body = eventDoc.body; + + event.pageX = original.clientX + + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - + ( doc && doc.clientLeft || body && body.clientLeft || 0 ); + event.pageY = original.clientY + + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - + ( doc && doc.clientTop || body && body.clientTop || 0 ); + } + + // Add relatedTarget, if necessary + if ( !event.relatedTarget && fromElement ) { + event.relatedTarget = fromElement === event.target ? + original.toElement : + fromElement; + } + + // Add which for click: 1 === left; 2 === middle; 3 === right + // Note: button is not normalized, so don't use it + if ( !event.which && button !== undefined ) { + event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) ); + } + + return event; + } + }, + + special: { + load: { + + // Prevent triggered image.load events from bubbling to window.load + noBubble: true + }, + focus: { + + // Fire native event if possible so blur/focus sequence is correct + trigger: function() { + if ( this !== safeActiveElement() && this.focus ) { + try { + this.focus(); + return false; + } catch ( e ) { + + // Support: IE<9 + // If we error on focus to hidden element (#1486, #12518), + // let .trigger() run the handlers + } + } + }, + delegateType: "focusin" + }, + blur: { + trigger: function() { + if ( this === safeActiveElement() && this.blur ) { + this.blur(); + return false; + } + }, + delegateType: "focusout" + }, + click: { + + // For checkbox, fire native event so checked state will be right + trigger: function() { + if ( jQuery.nodeName( this, "input" ) && this.type === "checkbox" && this.click ) { + this.click(); + return false; + } + }, + + // For cross-browser consistency, don't fire native .click() on links + _default: function( event ) { + return jQuery.nodeName( event.target, "a" ); + } + }, + + beforeunload: { + postDispatch: function( event ) { + + // Support: Firefox 20+ + // Firefox doesn't alert if the returnValue field is not set. + if ( event.result !== undefined && event.originalEvent ) { + event.originalEvent.returnValue = event.result; + } + } + } + }, + + // Piggyback on a donor event to simulate a different one + simulate: function( type, elem, event ) { + var e = jQuery.extend( + new jQuery.Event(), + event, + { + type: type, + isSimulated: true + + // Previously, `originalEvent: {}` was set here, so stopPropagation call + // would not be triggered on donor event, since in our own + // jQuery.event.stopPropagation function we had a check for existence of + // originalEvent.stopPropagation method, so, consequently it would be a noop. + // + // Guard for simulated events was moved to jQuery.event.stopPropagation function + // since `originalEvent` should point to the original event for the + // constancy with other events and for more focused logic + } + ); + + jQuery.event.trigger( e, null, elem ); + + if ( e.isDefaultPrevented() ) { + event.preventDefault(); + } + } +}; + +jQuery.removeEvent = document.removeEventListener ? + function( elem, type, handle ) { + + // This "if" is needed for plain objects + if ( elem.removeEventListener ) { + elem.removeEventListener( type, handle ); + } + } : + function( elem, type, handle ) { + var name = "on" + type; + + if ( elem.detachEvent ) { + + // #8545, #7054, preventing memory leaks for custom events in IE6-8 + // detachEvent needed property on element, by name of that event, + // to properly expose it to GC + if ( typeof elem[ name ] === "undefined" ) { + elem[ name ] = null; + } + + elem.detachEvent( name, handle ); + } + }; + +jQuery.Event = function( src, props ) { + + // Allow instantiation without the 'new' keyword + if ( !( this instanceof jQuery.Event ) ) { + return new jQuery.Event( src, props ); + } + + // Event object + if ( src && src.type ) { + this.originalEvent = src; + this.type = src.type; + + // Events bubbling up the document may have been marked as prevented + // by a handler lower down the tree; reflect the correct value. + this.isDefaultPrevented = src.defaultPrevented || + src.defaultPrevented === undefined && + + // Support: IE < 9, Android < 4.0 + src.returnValue === false ? + returnTrue : + returnFalse; + + // Event type + } else { + this.type = src; + } + + // Put explicitly provided properties onto the event object + if ( props ) { + jQuery.extend( this, props ); + } + + // Create a timestamp if incoming event doesn't have one + this.timeStamp = src && src.timeStamp || jQuery.now(); + + // Mark it as fixed + this[ jQuery.expando ] = true; +}; + +// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding +// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html +jQuery.Event.prototype = { + constructor: jQuery.Event, + isDefaultPrevented: returnFalse, + isPropagationStopped: returnFalse, + isImmediatePropagationStopped: returnFalse, + + preventDefault: function() { + var e = this.originalEvent; + + this.isDefaultPrevented = returnTrue; + if ( !e ) { + return; + } + + // If preventDefault exists, run it on the original event + if ( e.preventDefault ) { + e.preventDefault(); + + // Support: IE + // Otherwise set the returnValue property of the original event to false + } else { + e.returnValue = false; + } + }, + stopPropagation: function() { + var e = this.originalEvent; + + this.isPropagationStopped = returnTrue; + + if ( !e || this.isSimulated ) { + return; + } + + // If stopPropagation exists, run it on the original event + if ( e.stopPropagation ) { + e.stopPropagation(); + } + + // Support: IE + // Set the cancelBubble property of the original event to true + e.cancelBubble = true; + }, + stopImmediatePropagation: function() { + var e = this.originalEvent; + + this.isImmediatePropagationStopped = returnTrue; + + if ( e && e.stopImmediatePropagation ) { + e.stopImmediatePropagation(); + } + + this.stopPropagation(); + } +}; + +// Create mouseenter/leave events using mouseover/out and event-time checks +// so that event delegation works in jQuery. +// Do the same for pointerenter/pointerleave and pointerover/pointerout +// +// Support: Safari 7 only +// Safari sends mouseenter too often; see: +// https://code.google.com/p/chromium/issues/detail?id=470258 +// for the description of the bug (it existed in older Chrome versions as well). +jQuery.each( { + mouseenter: "mouseover", + mouseleave: "mouseout", + pointerenter: "pointerover", + pointerleave: "pointerout" +}, function( orig, fix ) { + jQuery.event.special[ orig ] = { + delegateType: fix, + bindType: fix, + + handle: function( event ) { + var ret, + target = this, + related = event.relatedTarget, + handleObj = event.handleObj; + + // For mouseenter/leave call the handler if related is outside the target. + // NB: No relatedTarget if the mouse left/entered the browser window + if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) { + event.type = handleObj.origType; + ret = handleObj.handler.apply( this, arguments ); + event.type = fix; + } + return ret; + } + }; +} ); + +// IE submit delegation +if ( !support.submit ) { + + jQuery.event.special.submit = { + setup: function() { + + // Only need this for delegated form submit events + if ( jQuery.nodeName( this, "form" ) ) { + return false; + } + + // Lazy-add a submit handler when a descendant form may potentially be submitted + jQuery.event.add( this, "click._submit keypress._submit", function( e ) { + + // Node name check avoids a VML-related crash in IE (#9807) + var elem = e.target, + form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? + + // Support: IE <=8 + // We use jQuery.prop instead of elem.form + // to allow fixing the IE8 delegated submit issue (gh-2332) + // by 3rd party polyfills/workarounds. + jQuery.prop( elem, "form" ) : + undefined; + + if ( form && !jQuery._data( form, "submit" ) ) { + jQuery.event.add( form, "submit._submit", function( event ) { + event._submitBubble = true; + } ); + jQuery._data( form, "submit", true ); + } + } ); + + // return undefined since we don't need an event listener + }, + + postDispatch: function( event ) { + + // If form was submitted by the user, bubble the event up the tree + if ( event._submitBubble ) { + delete event._submitBubble; + if ( this.parentNode && !event.isTrigger ) { + jQuery.event.simulate( "submit", this.parentNode, event ); + } + } + }, + + teardown: function() { + + // Only need this for delegated form submit events + if ( jQuery.nodeName( this, "form" ) ) { + return false; + } + + // Remove delegated handlers; cleanData eventually reaps submit handlers attached above + jQuery.event.remove( this, "._submit" ); + } + }; +} + +// IE change delegation and checkbox/radio fix +if ( !support.change ) { + + jQuery.event.special.change = { + + setup: function() { + + if ( rformElems.test( this.nodeName ) ) { + + // IE doesn't fire change on a check/radio until blur; trigger it on click + // after a propertychange. Eat the blur-change in special.change.handle. + // This still fires onchange a second time for check/radio after blur. + if ( this.type === "checkbox" || this.type === "radio" ) { + jQuery.event.add( this, "propertychange._change", function( event ) { + if ( event.originalEvent.propertyName === "checked" ) { + this._justChanged = true; + } + } ); + jQuery.event.add( this, "click._change", function( event ) { + if ( this._justChanged && !event.isTrigger ) { + this._justChanged = false; + } + + // Allow triggered, simulated change events (#11500) + jQuery.event.simulate( "change", this, event ); + } ); + } + return false; + } + + // Delegated event; lazy-add a change handler on descendant inputs + jQuery.event.add( this, "beforeactivate._change", function( e ) { + var elem = e.target; + + if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "change" ) ) { + jQuery.event.add( elem, "change._change", function( event ) { + if ( this.parentNode && !event.isSimulated && !event.isTrigger ) { + jQuery.event.simulate( "change", this.parentNode, event ); + } + } ); + jQuery._data( elem, "change", true ); + } + } ); + }, + + handle: function( event ) { + var elem = event.target; + + // Swallow native change events from checkbox/radio, we already triggered them above + if ( this !== elem || event.isSimulated || event.isTrigger || + ( elem.type !== "radio" && elem.type !== "checkbox" ) ) { + + return event.handleObj.handler.apply( this, arguments ); + } + }, + + teardown: function() { + jQuery.event.remove( this, "._change" ); + + return !rformElems.test( this.nodeName ); + } + }; +} + +// Support: Firefox +// Firefox doesn't have focus(in | out) events +// Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787 +// +// Support: Chrome, Safari +// focus(in | out) events fire after focus & blur events, +// which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order +// Related ticket - https://code.google.com/p/chromium/issues/detail?id=449857 +if ( !support.focusin ) { + jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) { + + // Attach a single capturing handler on the document while someone wants focusin/focusout + var handler = function( event ) { + jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) ); + }; + + jQuery.event.special[ fix ] = { + setup: function() { + var doc = this.ownerDocument || this, + attaches = jQuery._data( doc, fix ); + + if ( !attaches ) { + doc.addEventListener( orig, handler, true ); + } + jQuery._data( doc, fix, ( attaches || 0 ) + 1 ); + }, + teardown: function() { + var doc = this.ownerDocument || this, + attaches = jQuery._data( doc, fix ) - 1; + + if ( !attaches ) { + doc.removeEventListener( orig, handler, true ); + jQuery._removeData( doc, fix ); + } else { + jQuery._data( doc, fix, attaches ); + } + } + }; + } ); +} + +jQuery.fn.extend( { + + on: function( types, selector, data, fn ) { + return on( this, types, selector, data, fn ); + }, + one: function( types, selector, data, fn ) { + return on( this, types, selector, data, fn, 1 ); + }, + off: function( types, selector, fn ) { + var handleObj, type; + if ( types && types.preventDefault && types.handleObj ) { + + // ( event ) dispatched jQuery.Event + handleObj = types.handleObj; + jQuery( types.delegateTarget ).off( + handleObj.namespace ? + handleObj.origType + "." + handleObj.namespace : + handleObj.origType, + handleObj.selector, + handleObj.handler + ); + return this; + } + if ( typeof types === "object" ) { + + // ( types-object [, selector] ) + for ( type in types ) { + this.off( type, selector, types[ type ] ); + } + return this; + } + if ( selector === false || typeof selector === "function" ) { + + // ( types [, fn] ) + fn = selector; + selector = undefined; + } + if ( fn === false ) { + fn = returnFalse; + } + return this.each( function() { + jQuery.event.remove( this, types, fn, selector ); + } ); + }, + + trigger: function( type, data ) { + return this.each( function() { + jQuery.event.trigger( type, data, this ); + } ); + }, + triggerHandler: function( type, data ) { + var elem = this[ 0 ]; + if ( elem ) { + return jQuery.event.trigger( type, data, elem, true ); + } + } +} ); + + +var rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g, + rnoshimcache = new RegExp( "<(?:" + nodeNames + ")[\\s/>]", "i" ), + rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi, + + // Support: IE 10-11, Edge 10240+ + // In IE/Edge using regex groups here causes severe slowdowns. + // See https://connect.microsoft.com/IE/feedback/details/1736512/ + rnoInnerhtml = /\s*$/g, + safeFragment = createSafeFragment( document ), + fragmentDiv = safeFragment.appendChild( document.createElement( "div" ) ); + +// Support: IE<8 +// Manipulating tables requires a tbody +function manipulationTarget( elem, content ) { + return jQuery.nodeName( elem, "table" ) && + jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ? + + elem.getElementsByTagName( "tbody" )[ 0 ] || + elem.appendChild( elem.ownerDocument.createElement( "tbody" ) ) : + elem; +} + +// Replace/restore the type attribute of script elements for safe DOM manipulation +function disableScript( elem ) { + elem.type = ( jQuery.find.attr( elem, "type" ) !== null ) + "/" + elem.type; + return elem; +} +function restoreScript( elem ) { + var match = rscriptTypeMasked.exec( elem.type ); + if ( match ) { + elem.type = match[ 1 ]; + } else { + elem.removeAttribute( "type" ); + } + return elem; +} + +function cloneCopyEvent( src, dest ) { + if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) { + return; + } + + var type, i, l, + oldData = jQuery._data( src ), + curData = jQuery._data( dest, oldData ), + events = oldData.events; + + if ( events ) { + delete curData.handle; + curData.events = {}; + + for ( type in events ) { + for ( i = 0, l = events[ type ].length; i < l; i++ ) { + jQuery.event.add( dest, type, events[ type ][ i ] ); + } + } + } + + // make the cloned public data object a copy from the original + if ( curData.data ) { + curData.data = jQuery.extend( {}, curData.data ); + } +} + +function fixCloneNodeIssues( src, dest ) { + var nodeName, e, data; + + // We do not need to do anything for non-Elements + if ( dest.nodeType !== 1 ) { + return; + } + + nodeName = dest.nodeName.toLowerCase(); + + // IE6-8 copies events bound via attachEvent when using cloneNode. + if ( !support.noCloneEvent && dest[ jQuery.expando ] ) { + data = jQuery._data( dest ); + + for ( e in data.events ) { + jQuery.removeEvent( dest, e, data.handle ); + } + + // Event data gets referenced instead of copied if the expando gets copied too + dest.removeAttribute( jQuery.expando ); + } + + // IE blanks contents when cloning scripts, and tries to evaluate newly-set text + if ( nodeName === "script" && dest.text !== src.text ) { + disableScript( dest ).text = src.text; + restoreScript( dest ); + + // IE6-10 improperly clones children of object elements using classid. + // IE10 throws NoModificationAllowedError if parent is null, #12132. + } else if ( nodeName === "object" ) { + if ( dest.parentNode ) { + dest.outerHTML = src.outerHTML; + } + + // This path appears unavoidable for IE9. When cloning an object + // element in IE9, the outerHTML strategy above is not sufficient. + // If the src has innerHTML and the destination does not, + // copy the src.innerHTML into the dest.innerHTML. #10324 + if ( support.html5Clone && ( src.innerHTML && !jQuery.trim( dest.innerHTML ) ) ) { + dest.innerHTML = src.innerHTML; + } + + } else if ( nodeName === "input" && rcheckableType.test( src.type ) ) { + + // IE6-8 fails to persist the checked state of a cloned checkbox + // or radio button. Worse, IE6-7 fail to give the cloned element + // a checked appearance if the defaultChecked value isn't also set + + dest.defaultChecked = dest.checked = src.checked; + + // IE6-7 get confused and end up setting the value of a cloned + // checkbox/radio button to an empty string instead of "on" + if ( dest.value !== src.value ) { + dest.value = src.value; + } + + // IE6-8 fails to return the selected option to the default selected + // state when cloning options + } else if ( nodeName === "option" ) { + dest.defaultSelected = dest.selected = src.defaultSelected; + + // IE6-8 fails to set the defaultValue to the correct value when + // cloning other types of input fields + } else if ( nodeName === "input" || nodeName === "textarea" ) { + dest.defaultValue = src.defaultValue; + } +} + +function domManip( collection, args, callback, ignored ) { + + // Flatten any nested arrays + args = concat.apply( [], args ); + + var first, node, hasScripts, + scripts, doc, fragment, + i = 0, + l = collection.length, + iNoClone = l - 1, + value = args[ 0 ], + isFunction = jQuery.isFunction( value ); + + // We can't cloneNode fragments that contain checked, in WebKit + if ( isFunction || + ( l > 1 && typeof value === "string" && + !support.checkClone && rchecked.test( value ) ) ) { + return collection.each( function( index ) { + var self = collection.eq( index ); + if ( isFunction ) { + args[ 0 ] = value.call( this, index, self.html() ); + } + domManip( self, args, callback, ignored ); + } ); + } + + if ( l ) { + fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored ); + first = fragment.firstChild; + + if ( fragment.childNodes.length === 1 ) { + fragment = first; + } + + // Require either new content or an interest in ignored elements to invoke the callback + if ( first || ignored ) { + scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); + hasScripts = scripts.length; + + // Use the original fragment for the last item + // instead of the first because it can end up + // being emptied incorrectly in certain situations (#8070). + for ( ; i < l; i++ ) { + node = fragment; + + if ( i !== iNoClone ) { + node = jQuery.clone( node, true, true ); + + // Keep references to cloned scripts for later restoration + if ( hasScripts ) { + + // Support: Android<4.1, PhantomJS<2 + // push.apply(_, arraylike) throws on ancient WebKit + jQuery.merge( scripts, getAll( node, "script" ) ); + } + } + + callback.call( collection[ i ], node, i ); + } + + if ( hasScripts ) { + doc = scripts[ scripts.length - 1 ].ownerDocument; + + // Reenable scripts + jQuery.map( scripts, restoreScript ); + + // Evaluate executable scripts on first document insertion + for ( i = 0; i < hasScripts; i++ ) { + node = scripts[ i ]; + if ( rscriptType.test( node.type || "" ) && + !jQuery._data( node, "globalEval" ) && + jQuery.contains( doc, node ) ) { + + if ( node.src ) { + + // Optional AJAX dependency, but won't run scripts if not present + if ( jQuery._evalUrl ) { + jQuery._evalUrl( node.src ); + } + } else { + jQuery.globalEval( + ( node.text || node.textContent || node.innerHTML || "" ) + .replace( rcleanScript, "" ) + ); + } + } + } + } + + // Fix #11809: Avoid leaking memory + fragment = first = null; + } + } + + return collection; +} + +function remove( elem, selector, keepData ) { + var node, + elems = selector ? jQuery.filter( selector, elem ) : elem, + i = 0; + + for ( ; ( node = elems[ i ] ) != null; i++ ) { + + if ( !keepData && node.nodeType === 1 ) { + jQuery.cleanData( getAll( node ) ); + } + + if ( node.parentNode ) { + if ( keepData && jQuery.contains( node.ownerDocument, node ) ) { + setGlobalEval( getAll( node, "script" ) ); + } + node.parentNode.removeChild( node ); + } + } + + return elem; +} + +jQuery.extend( { + htmlPrefilter: function( html ) { + return html.replace( rxhtmlTag, "<$1>" ); + }, + + clone: function( elem, dataAndEvents, deepDataAndEvents ) { + var destElements, node, clone, i, srcElements, + inPage = jQuery.contains( elem.ownerDocument, elem ); + + if ( support.html5Clone || jQuery.isXMLDoc( elem ) || + !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) { + + clone = elem.cloneNode( true ); + + // IE<=8 does not properly clone detached, unknown element nodes + } else { + fragmentDiv.innerHTML = elem.outerHTML; + fragmentDiv.removeChild( clone = fragmentDiv.firstChild ); + } + + if ( ( !support.noCloneEvent || !support.noCloneChecked ) && + ( elem.nodeType === 1 || elem.nodeType === 11 ) && !jQuery.isXMLDoc( elem ) ) { + + // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2 + destElements = getAll( clone ); + srcElements = getAll( elem ); + + // Fix all IE cloning issues + for ( i = 0; ( node = srcElements[ i ] ) != null; ++i ) { + + // Ensure that the destination node is not null; Fixes #9587 + if ( destElements[ i ] ) { + fixCloneNodeIssues( node, destElements[ i ] ); + } + } + } + + // Copy the events from the original to the clone + if ( dataAndEvents ) { + if ( deepDataAndEvents ) { + srcElements = srcElements || getAll( elem ); + destElements = destElements || getAll( clone ); + + for ( i = 0; ( node = srcElements[ i ] ) != null; i++ ) { + cloneCopyEvent( node, destElements[ i ] ); + } + } else { + cloneCopyEvent( elem, clone ); + } + } + + // Preserve script evaluation history + destElements = getAll( clone, "script" ); + if ( destElements.length > 0 ) { + setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); + } + + destElements = srcElements = node = null; + + // Return the cloned set + return clone; + }, + + cleanData: function( elems, /* internal */ forceAcceptData ) { + var elem, type, id, data, + i = 0, + internalKey = jQuery.expando, + cache = jQuery.cache, + attributes = support.attributes, + special = jQuery.event.special; + + for ( ; ( elem = elems[ i ] ) != null; i++ ) { + if ( forceAcceptData || acceptData( elem ) ) { + + id = elem[ internalKey ]; + data = id && cache[ id ]; + + if ( data ) { + if ( data.events ) { + for ( type in data.events ) { + if ( special[ type ] ) { + jQuery.event.remove( elem, type ); + + // This is a shortcut to avoid jQuery.event.remove's overhead + } else { + jQuery.removeEvent( elem, type, data.handle ); + } + } + } + + // Remove cache only if it was not already removed by jQuery.event.remove + if ( cache[ id ] ) { + + delete cache[ id ]; + + // Support: IE<9 + // IE does not allow us to delete expando properties from nodes + // IE creates expando attributes along with the property + // IE does not have a removeAttribute function on Document nodes + if ( !attributes && typeof elem.removeAttribute !== "undefined" ) { + elem.removeAttribute( internalKey ); + + // Webkit & Blink performance suffers when deleting properties + // from DOM nodes, so set to undefined instead + // https://code.google.com/p/chromium/issues/detail?id=378607 + } else { + elem[ internalKey ] = undefined; + } + + deletedIds.push( id ); + } + } + } + } + } +} ); + +jQuery.fn.extend( { + + // Keep domManip exposed until 3.0 (gh-2225) + domManip: domManip, + + detach: function( selector ) { + return remove( this, selector, true ); + }, + + remove: function( selector ) { + return remove( this, selector ); + }, + + text: function( value ) { + return access( this, function( value ) { + return value === undefined ? + jQuery.text( this ) : + this.empty().append( + ( this[ 0 ] && this[ 0 ].ownerDocument || document ).createTextNode( value ) + ); + }, null, value, arguments.length ); + }, + + append: function() { + return domManip( this, arguments, function( elem ) { + if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { + var target = manipulationTarget( this, elem ); + target.appendChild( elem ); + } + } ); + }, + + prepend: function() { + return domManip( this, arguments, function( elem ) { + if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { + var target = manipulationTarget( this, elem ); + target.insertBefore( elem, target.firstChild ); + } + } ); + }, + + before: function() { + return domManip( this, arguments, function( elem ) { + if ( this.parentNode ) { + this.parentNode.insertBefore( elem, this ); + } + } ); + }, + + after: function() { + return domManip( this, arguments, function( elem ) { + if ( this.parentNode ) { + this.parentNode.insertBefore( elem, this.nextSibling ); + } + } ); + }, + + empty: function() { + var elem, + i = 0; + + for ( ; ( elem = this[ i ] ) != null; i++ ) { + + // Remove element nodes and prevent memory leaks + if ( elem.nodeType === 1 ) { + jQuery.cleanData( getAll( elem, false ) ); + } + + // Remove any remaining nodes + while ( elem.firstChild ) { + elem.removeChild( elem.firstChild ); + } + + // If this is a select, ensure that it displays empty (#12336) + // Support: IE<9 + if ( elem.options && jQuery.nodeName( elem, "select" ) ) { + elem.options.length = 0; + } + } + + return this; + }, + + clone: function( dataAndEvents, deepDataAndEvents ) { + dataAndEvents = dataAndEvents == null ? false : dataAndEvents; + deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; + + return this.map( function() { + return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); + } ); + }, + + html: function( value ) { + return access( this, function( value ) { + var elem = this[ 0 ] || {}, + i = 0, + l = this.length; + + if ( value === undefined ) { + return elem.nodeType === 1 ? + elem.innerHTML.replace( rinlinejQuery, "" ) : + undefined; + } + + // See if we can take a shortcut and just use innerHTML + if ( typeof value === "string" && !rnoInnerhtml.test( value ) && + ( support.htmlSerialize || !rnoshimcache.test( value ) ) && + ( support.leadingWhitespace || !rleadingWhitespace.test( value ) ) && + !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) { + + value = jQuery.htmlPrefilter( value ); + + try { + for ( ; i < l; i++ ) { + + // Remove element nodes and prevent memory leaks + elem = this[ i ] || {}; + if ( elem.nodeType === 1 ) { + jQuery.cleanData( getAll( elem, false ) ); + elem.innerHTML = value; + } + } + + elem = 0; + + // If using innerHTML throws an exception, use the fallback method + } catch ( e ) {} + } + + if ( elem ) { + this.empty().append( value ); + } + }, null, value, arguments.length ); + }, + + replaceWith: function() { + var ignored = []; + + // Make the changes, replacing each non-ignored context element with the new content + return domManip( this, arguments, function( elem ) { + var parent = this.parentNode; + + if ( jQuery.inArray( this, ignored ) < 0 ) { + jQuery.cleanData( getAll( this ) ); + if ( parent ) { + parent.replaceChild( elem, this ); + } + } + + // Force callback invocation + }, ignored ); + } +} ); + +jQuery.each( { + appendTo: "append", + prependTo: "prepend", + insertBefore: "before", + insertAfter: "after", + replaceAll: "replaceWith" +}, function( name, original ) { + jQuery.fn[ name ] = function( selector ) { + var elems, + i = 0, + ret = [], + insert = jQuery( selector ), + last = insert.length - 1; + + for ( ; i <= last; i++ ) { + elems = i === last ? this : this.clone( true ); + jQuery( insert[ i ] )[ original ]( elems ); + + // Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get() + push.apply( ret, elems.get() ); + } + + return this.pushStack( ret ); + }; +} ); + + +var iframe, + elemdisplay = { + + // Support: Firefox + // We have to pre-define these values for FF (#10227) + HTML: "block", + BODY: "block" + }; + +/** + * Retrieve the actual display of a element + * @param {String} name nodeName of the element + * @param {Object} doc Document object + */ + +// Called only from within defaultDisplay +function actualDisplay( name, doc ) { + var elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ), + + display = jQuery.css( elem[ 0 ], "display" ); + + // We don't have any data stored on the element, + // so use "detach" method as fast way to get rid of the element + elem.detach(); + + return display; +} + +/** + * Try to determine the default display value of an element + * @param {String} nodeName + */ +function defaultDisplay( nodeName ) { + var doc = document, + display = elemdisplay[ nodeName ]; + + if ( !display ) { + display = actualDisplay( nodeName, doc ); + + // If the simple way fails, read from inside an iframe + if ( display === "none" || !display ) { + + // Use the already-created iframe if possible + iframe = ( iframe || jQuery( "